SAPContext
Analyze ABAP/CDS dependencies, impact, usages, and include structures to understand objects before edits and see what breaks when a CDS view changes.
Instructions
SHLP: default/deps returns active partial interface metadata, as SAPRead; no KTD or dependency traversal. Primary tool for understanding ABAP/CDS objects. KTD when available, then dependency contracts. Use SAPRead after SAPContext for exact source/methods/grep/drafts.
Decision rule — pick the action from the user's question:
"What breaks if I change ?" / "Who consumes <I_*>?" / "Blast radius" → action="impact" (DDLS only).
"Which includes/appends extend ?" → action="structure", type="TABL".
"What does do?" / "Explain" / "deps before editing" → action="deps" (default); type+name required.
"Find all callers of " → action="usages" (live SAP where-used lookup).
impact: upstream CDS dependencies, downstream where-used in RAP buckets, and sibling-consistency hints. Prefer it to SQL source scans. See action/options below. deps: target KTD when available + selected dependency contracts, derived from source (not SAP-native relationships or a complete inventory). Counts distinguish root candidates from recursive attempts. Standard helper names are filtered. For CDS, includes dependency DDL/field catalogs for cl_cds_test_environment. structure (TABL only): the DDIC include/append tree.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>"
},
"name": "SAPContext"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Object name (e.g., ZCL_ORDER) | |
| type | No | Root type. deps requires type+name, even with source. Optional for action="impact" (defaults to DDLS) or usages (unique name lookup); structure requires TABL. | |
| depth | No | Dependency depth: 1 = direct deps only (default), 2 = deps of deps, 3 = maximum. Higher depth = more context but more SAP calls. | |
| group | No | Required for FUNC type. The function group containing the function module. | |
| action | No | Action: "impact" = CDS blast-radius analysis (DDLS only). USE THIS for any question like "what breaks if I change <view>", "who consumes <I_*>", "impact analysis on <CDS>", "downstream of <view>". Returns upstream AST dependencies + downstream where-used classified into RAP buckets (projectionViews, bdefs, serviceDefinitions, serviceBindings, accessControls, metadataExtensions, abapConsumers, documentation, tables, other), plus additive sibling-consistency diagnostics (consistencyHints + siblingExtensionAnalysis) when related DDLS siblings show asymmetric DDLX coverage. ALWAYS prefer over SAPQuery against DDDDLSRC/ACMDCLSRC/DDLXSRC_SRC/SRVDSRC_SRC (those text-scans produce noise this classifier filters out). Non-DDLS input returns a guardrail error. "deps" (default) = source-derived dependency contracts plus KTD when available. Requires type+name, even with source. Not a complete inventory; read source for behavior. "usages" = live SAP where-used lookup. Provide "type" when known; without it, the name must resolve uniquely. Prefer "impact" for CDS. "structure" = TABL includes/appends. | |
| source | No | Optional: provide source directly instead of fetching from SAP. Saves one round-trip if you already have the source from SAPRead. | |
| maxDeps | No | Max dependencies to resolve (default 20). Lower = faster + fewer tokens. | |
| includeKtd | No | deps: When true/default, prepend the object Knowledge Transfer Document (KTD/SKTD) when one exists. Set false to skip the KTD lookup. | |
| maxResults | No | usages: max entries (default 100); impact: max per downstream bucket (default 50). Max 1000. "usageCount"/"summary" stay true totals, not page sizes. | |
| siblingCheck | No | impact: Enable sibling metadata-extension consistency analysis. Default true. | |
| includeIndirect | No | impact: Include indirect (transitive) downstream where-used entries. Default false. | |
| siblingMaxCandidates | No | impact: Maximum sibling DDLS candidates to compare. Default 4; hard cap 10. |