Skip to main content
Glama

SAPDiagnose

Diagnose ABAP objects and runtime errors: run syntax checks, unit tests, ATC checks, analyze dumps and traces, and propose quickfixes to resolve SAP system issues.

Instructions

Run diagnostics on ABAP objects and analyze runtime errors. Actions:

  • "syntax": syntax-check (name+type; optional version; optional source = pre-write dry-run, nothing written).

  • "unittest": run ABAP Unit tests (name+type).

  • "atc": run ATC checks (name+type; optional variant). "atc_variants": list variants + the system default (variant = name filter; read-only).

  • "cds_testcases": SAP-suggested ABAP Unit test cases for a CDS entity (name; read-only; SAP_BASIS 8.16+).

  • "object_state": compare active vs inactive source versions (name+type; CLAS compares all includes). Returns ETags/hashes/divergence flags.

  • "quickfix": get quick-fix proposals at a position (name+type+source+line; optional column, sourceUri).

  • "apply_quickfix": apply one proposal, return text deltas, no write (name+type+source+line+proposalUri+proposalUserContent; pass proposalUserContent through exactly).

  • "dumps": list/read ST22 short dumps (no id = list; id = read; includeFullText, sections).

  • "traces": list/analyze profiler traces (id+analysis: hitlist=hot spots, statements=call tree, dbAccesses=DB stats).

  • "trace_start": arm a profiler trace for the NEXT matching execution, then reproduce and read via "traces" (write scope; defaults: next HTTP request, SQL on).

  • "trace_requests": list armed trace requests. "trace_cancel": cancel one by id (write scope).

  • "system_messages": list SM02 messages. "gateway_errors": list /IWFND/ERROR_LOG (on-prem; detailUrl or id+errorType for detail).

  • "odata_perf": diagnose why an OData call is slow (url = host-relative path); returns the sap-statistics timing split (DB/ABAP/framework/auth). Read-only; needs allowDataPreview.

  • "authorization_trace": read the on-prem STUSERTRACE auth trace (SUAUTHVALTRC); needs SAP_ALLOW_DATA_PREVIEW.

  • "cds_sql": show the native SQL a CDS view compiles to (name; read-only).

  • "sql_trace_state" / "set_sql_trace_state" (sqlOn; needs SAP_ALLOW_WRITES) / "sql_trace_directory": ST05 SQL-trace control. Quickfix workflow: syntax/ATC → quickfix → apply_quickfix → write via SAPWrite. Full action reference: docs_page SAPDiagnose.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoDump or trace ID (for dumps/traces actions); also the trace-request id to cancel (for trace_cancel). Omit to list, provide to get details.
toNoOptional upper time boundary for feed-based diagnostics actions (system_messages/gateway_errors).
urlNoFor odata_perf: the host-relative OData path to probe, from the Fiori app's Network tab (e.g. "/sap/opu/odata4/sap/.../Entity?$filter=…"). Must be a path on the connected system — absolute URLs are rejected.
fromNoOptional lower time boundary for feed-based diagnostics actions (system_messages/gateway_errors).
lineNoSource line number for quickfix evaluation (required for quickfix/apply_quickfix).
nameNoObject name (for syntax/unittest/atc/object_state); the CDS entity / DDLS source name for cds_testcases and cds_sql
typeNoObject type (PROG, CLAS, etc.) (for syntax/unittest/atc/object_state)
userNoSAP-user filter for dumps, feeds, or authorization_trace.
sqlOnNoFor action="set_sql_trace_state": true to arm the ST05 SQL trace, false to disarm. Combine with user to filter the trace to one SAP user.
actionYesDiagnostic action
columnNoSource column number for quickfix evaluation (default 0 for quickfix actions).
sourceNoCurrent source code (required for quickfix/apply_quickfix).
variantNoatc: check variant; atc_variants: name filter (*=all)
versionNoSource version for syntax check (default "active"). Use "inactive" to validate pending changes.
analysisNoTrace analysis type (for traces action with id). hitlist = execution hot spots, statements = call tree, dbAccesses = database access stats.
coverageNoFor action="unittest": also return statement/branch/procedure coverage for the object, plus methodsBelowFull — the methods below 100% statement coverage, worst first (what to test next) — in one extra round-trip. If the coverage endpoint or measurement is unavailable, returns the tests without coverage. Default false.
sectionsNoDump chapter IDs to include for dumps detail mode (for example ["kap0","kap3","kap8"]). Omit to use focused defaults.
sqlTraceNoFor trace_start: capture SQL/DB accesses (default true — required for analysis="dbAccesses").
aggregateNoFor trace_start: aggregate the trace (default true).
detailUrlNoADT detail URL for gateway_errors detail mode (preferred over id+errorType). Accepts absolute or /sap/bc/adt/... path.
errorTypeNoGateway error type for gateway_errors detail by id (for example "Frontend Error"). Required when using id without detailUrl.
sourceUriNoExact ADT source URI for quickfix/apply_quickfix. Defaults to the type/name main source; use this for class includes such as /includes/definitions.
traceUserNoFor trace_start/trace_requests: the SAP user whose matching execution is traced/listed. Defaults to the connected user.
authObjectNoAuthorization object filter, e.g. S_TCODE.
maxResultsNoMaximum results for dumps/system_messages/gateway_errors (default 50) or authorization_trace (default 100); bounded to a safe cap.
objectTypeNoFor trace_start: what to match within the process. Defaults to the valid type for the process type (http→url, dialog→transaction, batch→report, rfc→functionModule).
descriptionNoFor trace_start: optional label for the trace request.
processTypeNoFor trace_start: the kind of work process to capture. Default "http" (OData/Gateway). dialog = SAP GUI transaction, batch = background job, rfc = RFC call.
proposalUriNoQuickfix proposal URI from quickfix action (required for apply_quickfix).
expiresHoursNoFor trace_start: hours until the armed request auto-expires (default 24).
onlyFailuresNoFor authorization_trace: return only denied checks (RC<>0), similar to the SU53 failure view.
maxExecutionsNoFor trace_start: how many matching executions to capture before the request is consumed (default 1).
includeFullTextNoFor dumps detail mode only: include full formattedText blob. Default false to reduce token usage.
proposalUserContentNoOpaque userContent from quickfix action (required for apply_quickfix). May be an empty string; pass through exactly.
proposalAffectedObjectsNoOptional affectedObjects array from quickfix action. Include content for each affected source unit when applying multi-object quickfixes.
Behavior4/5

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

Even though annotations only provide readOnlyHint=false and destructiveHint=false (which the description correctly aligns with by flagging write-scoped actions like trace_start, trace_cancel, set_sql_trace_state), the description goes well beyond. It discloses critical side effects such as trace_start arming 'a profiler trace for the NEXT matching execution', the ST05 trace control needing SAP_ALLOW_WRITES, the read-only nature of cds_testcases/object_state/cds_sql, and odata_perf/authorization_trace needing allowDataPreview. It also discloses defaults (next HTTP request, SQL on, auto-expiry 24h) and dependencies like SAP_BASIS 8.16+ for cds_testcases. This adds genuine behavioral context beyond annotations.

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 long but appropriately so for a 21-action tool, and it's front-loaded with a clear mission statement and bullet-style action list. It ends with a workflow summary and pointer to a docs page. Each action line is terse and packs multiple facts. It's not minimal, but every line carries distinct information for a genuinely complex interface. Minor deduct for density making it harder to scan for a specific action, though the logical grouping (diagnostics, traces, system info, CDS, auth) helps.

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?

Given 35 parameters, 21 enum actions, and no output schema to describe returns, the description is remarkably complete. It covers read/write scope, prerequisites (SAP_BASIS version, allowDataPreview, SAP_ALLOW_WRITES), defaults, dependencies between actions (quickfix→apply_quickfix, trace_start→traces), and unit-test coverage behavior. It even explains the coverage fallback when unavailable and the divergence flags for object_state. It's not a full 5 because a few actions (e.g., sql_trace_directory, atc_variants detail) get only one-line coverage, but for this complexity it's strong.

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. The description adds value by mapping parameters to their relevant actions (e.g., 'proposalUserContent... pass proposalUserContent through exactly', 'sourceUri... use this for class includes such as /includes/definitions', trace_start's processType/objectType/match semantics, and traceUser defaulting to connected user). Key parameters like proposalUserContent's exact-pass-through requirement and the odata_perf host-relative path constraint are clarified beyond the schema. Some nuance is inherited from the schema, but the description earns the extra point by clarifying multi-action parameter semantics and edge cases.

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 opens with a clear umbrella statement ('Run diagnostics on ABAP objects and analyze runtime errors') followed by an exhaustive action-by-action breakdown covering all 21 enum values. Each action has a specific verb+object pairing (syntax-check, run ABAP Unit tests, quick-fix proposals), and the read/write scope is flagged per action, cleanly distinguishing it from siblings like SAPRead, SAPManage, and SAPWrite (mentioned at the end). This is exemplary purpose clarity for a complex multi-action tool.

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

Usage Guidelines4/5

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

The description repeatedly states when to use specific actions and marks read-only versus write scope (e.g., 'pre-write dry-run, nothing written', 'write scope', 'read-only'). It even provides a quickfix workflow: 'syntax/ATC → quickfix → apply_quickfix → write via SAPWrite', which flags when NOT to use this tool (final writes go to SAPWrite). It doesn't systematically contrast with each sibling, but for a 21-action tool this is strong practical 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