Skip to main content
Glama
ethanhan2014

SAP ADT MCP Server

by ethanhan2014

get_trace_statements

Retrieve aggregated call tree with statement-level performance data for a trace ID. Analyze SQL and ABAP statement execution to identify performance bottlenecks.

Instructions

Get aggregated call tree with statement-level performance for a trace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
trace_idYesTrace ID from list_traces
system_idNoSAP system ID (e.g. DEV). Omit to use default system.

Implementation Reference

  • Tool registration: 'get_trace_statements' is registered in the ListToolsRequestSchema handler with its description and input schema (requires trace_id).
    {
      name: "get_trace_statements",
      description: "Get aggregated call tree with statement-level performance for a trace",
      inputSchema: {
        type: "object" as const,
        properties: {
          trace_id: { type: "string", description: "Trace ID from list_traces" },
          ...SYSTEM_ID_PROP,
        },
        required: ["trace_id"],
      },
    },
  • Trace ID schema (TraceIdSchema) used as input validation for get_trace_statements — requires a 'trace_id' string.
    // Trace schemas
    const TraceUserSchema = z.object({ user: z.string().optional() });
    const TraceIdSchema = z.object({ trace_id: z.string() });
  • Handler for the 'get_trace_statements' tool: parses trace_id from args via TraceIdSchema, calls client.getTraceStatements(trace_id), and returns the raw XML response.
    case "get_trace_statements": {
      const { trace_id } = TraceIdSchema.parse(args);
      const result = await client.getTraceStatements(trace_id);
      return { content: [{ type: "text", text: result }] };
    }
  • ClientPool imports AdtClient which contains the actual getTraceStatements method.
    import { AdtClient } from "./adt-client.js";
    import { SystemConfig } from "./types.js";
  • Implementation of getTraceStatements in AdtClient: makes a GET request to /sap/bc/adt/runtime/traces/abaptraces/{traceId}/statements with a 120s timeout, returns the raw XML response.
    async getTraceStatements(traceId: string): Promise<string> {
      const response = await this.http.get<string>(
        `/sap/bc/adt/runtime/traces/abaptraces/${encodeURIComponent(traceId)}/statements`,
        { headers: { Accept: "*/*" }, responseType: "text", timeout: 120000 }
      );
      return response.data;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states what is returned but does not disclose behavioral traits such as read-only nature, performance impact, or prerequisites like trace existence. With no annotations, more detail is needed.

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

Conciseness5/5

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

A single sentence that is front-loaded with key information, no redundancy or unnecessary words.

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 simple tool with two well-documented parameters and no output schema, the description is fairly complete. It could mention the return format but overall is sufficient.

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?

Schema description coverage is 100% with clear descriptions for both parameters. The tool description adds no additional meaning beyond the schema, so 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 clearly states the verb 'Get' and the resource 'aggregated call tree with statement-level performance for a trace', which is specific and distinguishes it from sibling tools like get_trace_hitlist or get_trace_db_access.

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

Usage Guidelines3/5

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

The description implies usage for trace performance analysis but provides no explicit guidance on when to use this tool versus alternatives, nor any conditions for use.

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/ethanhan2014/sap-adt-mcp'

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