Skip to main content
Glama

SAPContext

Read-only

Analyze ABAP/CDS object dependencies and impact before changes or reviews to avoid breaks.

Instructions

Primary tool for understanding ABAP/CDS objects before specs, reviews, explanations, or changes — use instead of SAPRead when the user asks what an object does. Returns intent first (the object KTD when available) then compressed dependency contracts. Use SAPRead after SAPContext for exact source/method bodies/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 (CDS blast-radius): upstream AST deps + downstream where-used, classified into RAP buckets (projectionViews, bdefs, serviceDefinitions, serviceBindings, accessControls, metadataExtensions, abapConsumers, documentation, tables, other) + sibling-consistency hints. Use this instead of text-scanning DDDDLSRC/ACMDCLSRC with SAPQuery (it filters the noise). Optional includeIndirect, siblingCheck, siblingMaxCandidates. 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.

Non-CDS reverse-lookup: SAPNavigate(references); CDS: impact. Full detail: docs_page SAPContext.

Input Schema

TableJSON 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. 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."
  2. 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."
  3. 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."
  4. 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"
      +]
  5. 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"
      +}
  6. Addedv0.9.6
  7. Removedv0.9.3
  8. 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)."
  9. First observedv0.6.4

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses that dependencies are 'derived from source (not SAP-native relationships or a complete inventory)', notes that 'Standard helper names are filtered', warns of a 'guardrail error' for non-DDLS impact input, and explains that higher depth costs more SAP calls. This level of behavioral detail far exceeds what the annotation provides.

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

Conciseness4/5

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

The description is well-structured with a clear opening purpose, a decision-rule table, and per-action details, front-loading the most important guidance. It is long, but that length is justified by the tool's complexity (12 parameters, 4 actions). It loses a point because some information is redundant with the action parameter description, which could be trimmed.

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

Completeness5/5

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

For a complex tool without an output schema, the description compensates thoroughly: it explains the conceptual return content per action (KTD, RAP buckets, dependency contracts, includes/appends), outlines limitations, names alternative tool routes, and covers parameter usage contexts. This is complete enough for an agent to decide and invoke the tool correctly.

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

Parameters3/5

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

The input schema already provides 100% parameter description coverage, including detailed constraints, enums, and defaults for all 12 parameters (e.g., action's full explanation, structure's TABL requirement). The tool description largely recaps this information rather than adding new semantic insight, so the baseline score of 3 applies.

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

Purpose5/5

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

The description states a specific purpose ('Primary tool for understanding ABAP/CDS objects') with a clear verb and resource, and explicitly distinguishes itself from sibling SAPRead ('use instead of SAPRead when the user asks what an object does'). It also summarizes the output format ('Returns intent first ... then compressed dependency contracts'), leaving no ambiguity about the tool's function.

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 description provides explicit when-to-use and when-not-to-use guidance: it directs users to SAPRead for exact source/method bodies, to SAPNavigate for non-CDS reverse-lookup, and states a preference over SAPQuery for CDS text-scans ('ALWAYS prefer over SAPQuery'). It even offers a decision rule mapping user questions to specific actions, which is exemplary routing.

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