Skip to main content
Glama
ethanhan2014

SAP ADT MCP Server

by ethanhan2014

list_cross_traces

Retrieve captured ABAP Cross Trace results for a user. Shows trace IDs, request types (OData V2/V4, URL, RFC), and service names to analyze trace data.

Instructions

List captured ABAP Cross Trace results for a user. Shows trace IDs, request types (OData V2/V4, URL, RFC, etc.), and service names.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userNoSAP username (default: current user)
system_idNoSAP system ID (e.g. DEV). Omit to use default system.

Implementation Reference

  • Registration of the 'list_cross_traces' tool in the MCP tool list, including its description and input schema (takes optional 'user' parameter).
      name: "list_cross_traces",
      description: "List captured ABAP Cross Trace results for a user. Shows trace IDs, request types (OData V2/V4, URL, RFC, etc.), and service names.",
      inputSchema: {
        type: "object" as const,
        properties: {
          user: { type: "string", description: "SAP username (default: current user)" },
          ...SYSTEM_ID_PROP,
        },
        required: [],
      },
    },
  • Handler for 'list_cross_traces' tool. Parses args with CrossTraceUserSchema, calls client.listCrossTraces(), parses XML response to extract trace IDs, request types, request names, and record counts, then formats output with top services summary.
    case "list_cross_traces": {
      const { user } = CrossTraceUserSchema.parse(args);
      const result = await client.listCrossTraces(user);
      const traces = [...result.matchAll(/<sxt:trace>([\s\S]*?)<\/sxt:trace>/g)];
      if (traces.length === 0) {
        return { content: [{ type: "text", text: "No cross traces found." }] };
      }
      const typeMap: Record<string, string> = {
        T: "Transaction", C: "RFC", U: "URL", S: "Submit", B: "Batch",
        V: "Update", O: "OData V2", "4": "OData V4", D: "Daemon", Q: "SQL Service",
      };
      const counts: Record<string, number> = {};
      const traceLines: string[] = [];
      for (const [, t] of traces) {
        const tid = t.match(/<sxt:traceId>([^<]+)<\/sxt:traceId>/)?.[1] ?? "?";
        const rtype = t.match(/<sxt:requestType>([^<]*)<\/sxt:requestType>/)?.[1] ?? "?";
        const rname = t.match(/<sxt:requestName>([^<]*)<\/sxt:requestName>/)?.[1] ?? "?";
        const nrecs = t.match(/<sxt:numberOfRecords>([^<]+)<\/sxt:numberOfRecords>/)?.[1] ?? "0";
        const typeName = typeMap[rtype] ?? rtype;
        counts[rname] = (counts[rname] || 0) + 1;
        traceLines.push(`  ${tid}  ${typeName.padEnd(10)}  ${rname}  (${nrecs} records)`);
      }
      const summary = Object.entries(counts)
        .sort((a, b) => b[1] - a[1])
        .slice(0, 10)
        .map(([cname, count]) => `  ${cname}: ${count}`)
        .join("\n");
      const lines = [
        `${traces.length} cross trace(s):\n`,
        `Top services:\n${summary}\n`,
        `All traces:`,
        ...traceLines,
      ];
      return { content: [{ type: "text", text: lines.join("\n") }] };
    }
  • Input schema 'CrossTraceUserSchema' used to validate arguments for the list_cross_traces handler (optional 'user' field).
    const CrossTraceUserSchema = z.object({ user: z.string().optional() });
    const CrossTraceRecordsSchema = z.object({ trace_id: z.string() });
  • Helper method 'listCrossTraces' in AdtClient that makes a GET request to /sap/bc/adt/crosstrace/traces?traceUser=... to fetch cross traces from the SAP system.
    async listCrossTraces(user?: string): Promise<string> {
      const traceUser = (user ?? this.config.username).toUpperCase();
      const response = await this.http.get<string>(
        `/sap/bc/adt/crosstrace/traces?traceUser=${encodeURIComponent(traceUser)}`,
        { headers: { Accept: "application/vnd.sap.adt.crosstrace.traces.v1+xml" }, responseType: "text" }
      );
      return response.data;
    }
Behavior2/5

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

No annotations provided, so description must disclose behavior. It only states listing action, missing details on side effects, idempotency, or permissions. Minimal transparency.

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?

Two concise sentences: first states purpose, second lists output fields. Front-loaded and no wasted words.

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

Completeness3/5

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

Adequately conveys core purpose but lacks details on output format, pagination, or default behavior when user parameter is omitted (schema covers defaults but description could reinforce). Leaves some gaps for an AI agent.

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 coverage is 100%, providing clear descriptions for parameters. Description adds marginal value by linking the user parameter to the 'for a user' aspect, but output fields mentioned are not parameter-related. 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?

Description clearly states it lists captured ABAP Cross Trace results for a user and specifies the fields returned (trace IDs, request types, service names), distinguishing it from sibling tools like list_traces or get_cross_trace_records.

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

Usage Guidelines2/5

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

Description provides no guidance on when to use this tool vs alternatives (e.g., list_traces, get_cross_trace_records). No when-not or context for selection.

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