Skip to main content
Glama

SAPContext

Read-only

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

NameRequiredDescriptionDefault
nameYesObject name (e.g., ZCL_ORDER)
typeNoRoot type. deps requires type+name, even with source. Optional for action="impact" (defaults to DDLS) or usages (unique name lookup); structure requires TABL.
depthNoDependency depth: 1 = direct deps only (default), 2 = deps of deps, 3 = maximum. Higher depth = more context but more SAP calls.
groupNoRequired for FUNC type. The function group containing the function module.
actionNoAction: "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.
sourceNoOptional: provide source directly instead of fetching from SAP. Saves one round-trip if you already have the source from SAPRead.
maxDepsNoMax dependencies to resolve (default 20). Lower = faster + fewer tokens.
includeKtdNodeps: When true/default, prepend the object Knowledge Transfer Document (KTD/SKTD) when one exists. Set false to skip the KTD lookup.
maxResultsNousages: max entries (default 100); impact: max per downstream bucket (default 50). Max 1000. "usageCount"/"summary" stay true totals, not page sizes.
siblingCheckNoimpact: Enable sibling metadata-extension consistency analysis. Default true.
includeIndirectNoimpact: Include indirect (transitive) downstream where-used entries. Default false.
siblingMaxCandidatesNoimpact: Maximum sibling DDLS candidates to compare. Default 4; hard cap 10.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.10.0
    • changedInput schema / properties / type / enum
      Previous value: -[
      -  "CLAS",
      -  "INTF",
      -  "PROG",
      -  "FUNC",
      -  "DDLS",
      -  "TABL"
      -]New value: +[
      +  "SHLP",
      +  "CLAS",
      +  "INTF",
      +  "PROG",
      +  "FUNC",
      +  "DDLS",
      +  "TABL"
      +]
  2. Changed2 schema fields changedv1.3.0
    • changedInput schema / properties / action / description
      Previous value: -"Action:\n\"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.\n\"deps\" (default, can be omitted) = object understanding / forward dependency context — \"what does <object> do?\" or \"what does <object> depend on?\". Returns the object KTD when available plus public API contracts of dependencies.\n\"usages\" = live SAP where-used lookup. Provide \"type\" when known; without it, the name must resolve uniquely. Prefer \"impact\" for CDS.\n\"structure\" = TABL includes/appends."New value: +"Action:\n\"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.\n\"deps\" (default) = source-derived dependency contracts plus KTD when available. Requires type+name, even with source. Not a complete inventory; read source for behavior.\n\"usages\" = live SAP where-used lookup. Provide \"type\" when known; without it, the name must resolve uniquely. Prefer \"impact\" for CDS.\n\"structure\" = TABL includes/appends."
    • changedInput schema / properties / type / description
      Previous value: -"Object type. Optional for action=\"impact\" (defaults to DDLS) or action=\"usages\"; required otherwise."New value: +"Root type. deps requires type+name, even with source. Optional for action=\"impact\" (defaults to DDLS) or usages (unique name lookup); structure requires TABL."
  3. Changed7 schema fields changedv1.0.2
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / includeIndirect / description
      Previous value: -"Only for action=\"impact\". Include indirect (transitive) downstream where-used entries. Default false."New value: +"impact: Include indirect (transitive) downstream where-used entries. Default false."
    • changedInput schema / properties / includeKtd / description
      Previous value: -"Only for action=\"deps\". When true/default, prepend the object Knowledge Transfer Document (KTD/SKTD) when one exists. Set false to skip the KTD lookup."New value: +"deps: When true/default, prepend the object Knowledge Transfer Document (KTD/SKTD) when one exists. Set false to skip the KTD lookup."
    • changedInput schema / properties / maxDeps / description
      Previous value: -"Maximum dependencies to resolve (default 20). Lower = faster + fewer tokens."New value: +"Max dependencies to resolve (default 20). Lower = faster + fewer tokens."
    • addedInput schema / properties / maxResults
      Added value: +{
      +  "description": "usages: max entries (default 100); impact: max per downstream bucket (default 50). Max 1000. \"usageCount\"/\"summary\" stay true totals, not page sizes.",
      +  "type": "number"
      +}
    • changedInput schema / properties / siblingCheck / description
      Previous value: -"Only for action=\"impact\". Enable sibling metadata-extension consistency analysis. Default true."New value: +"impact: Enable sibling metadata-extension consistency analysis. Default true."
    • changedInput schema / properties / siblingMaxCandidates / description
      Previous value: -"Only for action=\"impact\". Maximum sibling DDLS candidates to compare. Default 4; hard cap 10."New value: +"impact: Maximum sibling DDLS candidates to compare. Default 4; hard cap 10."
  4. Changed2 schema fields changedv0.9.27
    • changedInput schema / properties / action / description
      Previous value: -"Action:\n\"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.\n\"deps\" (default, can be omitted) = object understanding / forward dependency context — \"what does <object> do?\" or \"what does <object> depend on?\". Returns the object KTD when available plus public API contracts of dependencies.\n\"usages\" = reverse dependency lookup — \"who calls <object>?\". Requires cache warmup (--cache-warmup). Only \"name\" is needed. For CDS entities prefer action=\"impact\" instead.\n\"structure\" = TABL includes/appends."New value: +"Action:\n\"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.\n\"deps\" (default, can be omitted) = object understanding / forward dependency context — \"what does <object> do?\" or \"what does <object> depend on?\". Returns the object KTD when available plus public API contracts of dependencies.\n\"usages\" = live SAP where-used lookup. Provide \"type\" when known; without it, the name must resolve uniquely. Prefer \"impact\" for CDS.\n\"structure\" = TABL includes/appends."
    • changedInput schema / properties / type / description
      Previous value: -"Object type. Optional for action=\"impact\" (defaults to DDLS); required otherwise."New value: +"Object type. Optional for action=\"impact\" (defaults to DDLS) or action=\"usages\"; required otherwise."
  5. Changed4 schema fields changedv0.9.23
    • changedInput schema / properties / action / description
      Previous value: -"Action:\n\"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.\n\"deps\" (default, can be omitted) = object understanding / forward dependency context — \"what does <object> do?\" or \"what does <object> depend on?\". Returns the object KTD when available plus public API contracts of dependencies.\n\"usages\" = reverse dependency lookup — \"who calls <object>?\". Requires cache warmup (--cache-warmup). Only \"name\" is needed. For CDS entities prefer action=\"impact\" instead."New value: +"Action:\n\"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.\n\"deps\" (default, can be omitted) = object understanding / forward dependency context — \"what does <object> do?\" or \"what does <object> depend on?\". Returns the object KTD when available plus public API contracts of dependencies.\n\"usages\" = reverse dependency lookup — \"who calls <object>?\". Requires cache warmup (--cache-warmup). Only \"name\" is needed. For CDS entities prefer action=\"impact\" instead.\n\"structure\" = TABL includes/appends."
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "impact",
      -  "deps",
      -  "usages"
      -]New value: +[
      +  "impact",
      +  "deps",
      +  "usages",
      +  "structure"
      +]
    • changedInput schema / properties / type / description
      Previous value: -"Object type. Required for action=\"deps\" and action=\"usages\". Optional for action=\"impact\" — defaults to DDLS (the only supported type for impact)."New value: +"Object type. Optional for action=\"impact\" (defaults to DDLS); required otherwise."
    • changedInput schema / properties / type / enum
      Previous value: -[
      -  "CLAS",
      -  "INTF",
      -  "PROG",
      -  "FUNC",
      -  "DDLS"
      -]New value: +[
      +  "CLAS",
      +  "INTF",
      +  "PROG",
      +  "FUNC",
      +  "DDLS",
      +  "TABL"
      +]
  6. Changed2 schema fields changedv0.9.20
    • changedInput schema / properties / action / description
      Previous value: -"Action:\n\"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.\n\"deps\" (default, can be omitted) = forward dependency context — \"what does <object> depend on?\". Returns public API contracts of dependencies.\n\"usages\" = reverse dependency lookup — \"who calls <object>?\". Requires cache warmup (--cache-warmup). Only \"name\" is needed. For CDS entities prefer action=\"impact\" instead."New value: +"Action:\n\"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.\n\"deps\" (default, can be omitted) = object understanding / forward dependency context — \"what does <object> do?\" or \"what does <object> depend on?\". Returns the object KTD when available plus public API contracts of dependencies.\n\"usages\" = reverse dependency lookup — \"who calls <object>?\". Requires cache warmup (--cache-warmup). Only \"name\" is needed. For CDS entities prefer action=\"impact\" instead."
    • addedInput schema / properties / includeKtd
      Added value: +{
      +  "description": "Only for action=\"deps\". When true/default, prepend the object Knowledge Transfer Document (KTD/SKTD) when one exists. Set false to skip the KTD lookup.",
      +  "type": "boolean"
      +}
  7. Addedv0.9.6
  8. Removedv0.9.3
  9. Changed6 schema fields changedv0.7.2
    • changedInput schema / properties / action / description
      Previous value: -"Action: \"deps\" (default, can be omitted) = get dependency context. \"usages\" = reverse dependency lookup — find all objects that depend on the given name. Requires cache warmup (--cache-warmup). Only \"name\" is needed for usages."New value: +"Action:\n\"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.\n\"deps\" (default, can be omitted) = forward dependency context — \"what does <object> depend on?\". Returns public API contracts of dependencies.\n\"usages\" = reverse dependency lookup — \"who calls <object>?\". Requires cache warmup (--cache-warmup). Only \"name\" is needed. For CDS entities prefer action=\"impact\" instead."
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "deps",
      -  "usages"
      -]New value: +[
      +  "impact",
      +  "deps",
      +  "usages"
      +]
    • addedInput schema / properties / includeIndirect
      Added value: +{
      +  "description": "Only for action=\"impact\". Include indirect (transitive) downstream where-used entries. Default false.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / siblingCheck
      Added value: +{
      +  "description": "Only for action=\"impact\". Enable sibling metadata-extension consistency analysis. Default true.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / siblingMaxCandidates
      Added value: +{
      +  "description": "Only for action=\"impact\". Maximum sibling DDLS candidates to compare. Default 4; hard cap 10.",
      +  "type": "number"
      +}
    • changedInput schema / properties / type / description
      Previous value: -"Object type (required for deps action)"New value: +"Object type. Required for action=\"deps\" and action=\"usages\". Optional for action=\"impact\" — defaults to DDLS (the only supported type for impact)."
  10. First observedv0.6.4

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond readOnlyHint=true, the description discloses substantial behavior: non-DDLS input to impact returns a guardrail error, impact output is bucketed into named RAP categories plus consistencyHints/siblingExtensionAnalysis, deps is source-derived rather than a complete inventory, standard helper names are filtered, and counts distinguish root candidates from recursive attempts. This is well beyond what the annotation conveys.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The decision-rule block is well front-loaded and scannable, but the first sentence is confusing and partly self-contradictory, and the action semantics are restated in both the description and the action enum, creating redundancy. Density is high enough that trimming would help.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 12-parameter, four-mode tool with no output schema, the description covers routing, guardrails, and rough return shape (buckets, KTD prepend, consistency hints). It does not describe the concrete response shape for deps/structure or result ordering, but the essentials for correct invocation are present.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds selection logic the schema cannot express: which action fits which question, that impact is DDLS-only, that deps requires type+name even with source, and that structure requires TABL. Some of this duplicates the action enum's own description, limiting the added value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description identifies the resource (ABAP/CDS object metadata) and enumerates four distinct actions (impact, deps, usages, structure), which lets an agent distinguish it from SAPRead/SAPSearch. The opening line ("SHLP: default/deps returns active partial interface metadata, as SAPRead; no KTD or dependency traversal") is garbled and partially contradicts the later claim that deps includes KTD, muddying an otherwise clear purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The explicit decision rule maps user question phrasings ("What breaks if I change", "Which includes/appends extend", "Find all callers") directly to actions, and states defaults (deps). It also names alternatives: use SAPRead after SAPContext for exact source, and prefer impact over SAPQuery text scans against DDDDLSRC/ACMDCLSRC/DDLXSRC_SRC/SRVDSRC_SRC.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.