Skip to main content
Glama

SAPContext

Read-only

Analyzes ABAP/CDS objects to reveal their purpose, dependency contracts, and downstream impact before reviews or changes; use for blast-radius analysis and where-used lookups.

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).

  • "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 (default): target KTD + the public API contracts of its dependencies (not full source) — one compact response vs N SAPRead calls (7-30x fewer tokens); SAP standard objects filtered out. For CDS, includes dependency DDL/field catalogs for cl_cds_test_environment. structure (TABL only): the DDIC include/append tree.

Use SAPContext BEFORE editing existing objects. For non-CDS reverse-lookup use SAPNavigate(references); for CDS prefer impact. Full detail: docs_page SAPContext.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesObject name (e.g., ZCL_ORDER)
typeNoObject type. Optional for action="impact" (defaults to DDLS) or action="usages"; required otherwise.
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, 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. "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.
Behavior3/5

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

The readOnlyHint annotation already declares this is a safe read operation, so the bar is somewhat lowered. The description does add value beyond the annotation: it discloses token efficiency ('7-30x fewer tokens'), compression behavior ('returns compressed dependency contracts, not full source'), and filtering behavior (SAP standard objects filtered out). However, it does not describe the return response shape or what happens when KTD is unavailable, and the guardrail error behavior is only mentioned in the schema action text, not the top description. It's adequate but not rich.

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 dense and front-loaded with the critical scoping sentence first. The 'Decision rule' section uses bullet-free line breaks for scannability. It's reasonably complete but does get long, with some redundancy between the top description and the action field descriptions in the schema (e.g., the impact description appears in both places nearly verbatim). A tighter version could trim the duplicated impact enumeration while keeping the sibling-tool comparisons.

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?

Given the tool is genuinely complex — 12 parameters, 4 actions with action-specific parameter meanings (depth means different things per action, maxResults has different defaults per action) — the description is remarkably complete. It covers the decision matrix, cross-tool sequencing, token-cost tradeoffs, and specific per-action return semantics. It points to a docs page (docs_page SAPContext) for full detail. There's no output schema, so the description carries the burden of explaining what's returned, which it does well for each action bucket.

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 description coverage is 100% and each parameter's schema already has a detailed description. The tool description adds meaningful context on top: it explains the interplay between parameters (e.g., includeIndirect for transitive usages), and provides '7-30x fewer tokens' as motivation for depth/deps defaults. It documents the conditional requirements (type required unless impact/usages, group required for FUNC) that the schema alone doesn't fully convey semantically. This clearly exceeds the base-3 baseline.

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 has a very specific verb+resource: 'Primary tool for understanding ABAP/CDS objects before specs, reviews, explanations, or changes.' It clearly distinguishes from the sibling SAPRead by saying 'use instead of SAPRead when the user asks what an object does' and explicitly says to use SAPRead after for exact source/method bodies/grep/drafts. The action enumeration (impact/deps/usages/structure) maps clear verbs to concrete behaviors, further differentiating it from siblings like SAPNavigate and SAPQuery.

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?

Provides an explicit decision rule mapping user question phrasing to the correct action: 'What breaks if I change <CDS>?' → impact, 'What does <object> do?' → deps, 'Find all callers' → usages. It names the alternative (SAPRead) and the exact sequencing ('Use SAPRead after SAPContext'). It also states exclusions — non-DDLS input returns a guardrail error for impact, and prefers impact over text-scanning SAPQuery. This is exemplary when/why/when-not guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/arc-mcp/arc-1'

If you have feedback or need assistance with the MCP directory API, please join our Discord server