DESCRIBE CONTEXT
The DESCRIBE CONTEXT command assembles the surrounding context of an element within its module and project hierarchy. This is particularly useful for AI-assisted development, where an LLM needs to understand the neighborhood of an element to generate accurate code.
Prerequisites
Requires a full catalog refresh:
REFRESH CATALOG FULL;
Syntax
DESCRIBE CONTEXT OF <qualified-name>
Examples
-- Describe context of a microflow
DESCRIBE CONTEXT OF Sales.ACT_ProcessOrder;
-- Describe context of an entity
DESCRIBE CONTEXT OF Sales.Customer;
-- Describe context of a page
DESCRIBE CONTEXT OF Sales.CustomerOverview;
CLI Usage
# Basic context retrieval
mxcli context -p app.mpr Module.MyMicroflow
# With depth control
mxcli context -p app.mpr Module.MyMicroflow --depth 3
# MDL sources in the alpha language (mdl 0) instead of mdl 1
mxcli context -p app.mpr Module.MyMicroflow --mdl 0
The MDL sources are written in mdl 1, each headed by mdl 1;.
The --depth flag controls how many levels of related elements are included in the context output. A higher depth gives a broader picture but produces more output.
What Context Includes
The context command gathers information about:
- The element’s own definition (MDL source)
- Elements that call it (callers)
- Elements it calls (callees)
- Related entities and associations
- Pages that display or edit the same data
- The module structure surrounding the element
Use Case: AI-Assisted Development
When an AI assistant needs to modify a microflow, it uses DESCRIBE CONTEXT to understand:
- What parameters the microflow expects
- What entities and associations are involved
- What other microflows it interacts with
- What pages display the same data
This information allows the AI to generate code that fits naturally into the existing project structure.
# Gather context for an AI prompt
mxcli context -p app.mpr Sales.ACT_ProcessOrder --depth 2