Skip to main content
Glama
ethanhan2014

SAP ADT MCP Server

by ethanhan2014

attach_debugger

Troubleshoot ABAP code by attaching the debugger to a running session. Configure debug mode and optionally target a specific SAP system ID.

Instructions

Attach the debugger to a running ABAP session

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
debug_modeNoDebugging mode (default: user)
system_idNoSAP system ID (e.g. DEV). Omit to use default system.

Implementation Reference

  • The actual debugger attach logic: makes an HTTP POST to /sap/bc/adt/debugger?method=attach&debuggingMode=... with stateful headers. This is the core implementation that attaches the debugger to a running ABAP session.
    async debuggerAttach(debugMode = "user"): Promise<string> {
      this.ensureDebugSession();
      const resp = await this.http.post(
        `/sap/bc/adt/debugger?method=attach&debuggingMode=${encodeURIComponent(debugMode)}&requestUser=${encodeURIComponent(this.config.username.toUpperCase())}`,
        "",
        {
          headers: this.statefulHeaders({ Accept: "application/xml" }),
          responseType: "text",
        }
      );
      return resp.data as string;
    }
  • Tool registration in the ListToolsRequestSchema handler: defines the tool name, description, and input schema for the MCP tool listing.
      name: "attach_debugger",
      description: "Attach the debugger to a running ABAP session",
      inputSchema: {
        type: "object" as const,
        properties: {
          debug_mode: { type: "string", description: "Debugging mode (default: user)" },
          ...SYSTEM_ID_PROP,
        },
        required: [],
      },
    },
  • The CallToolRequestSchema handler for attach_debugger: parses the debug_mode argument from the request and delegates to client.debuggerAttach().
    case "attach_debugger": {
      const debugMode = (args as Record<string, unknown>)?.debug_mode as string | undefined;
      const result = await client.debuggerAttach(debugMode);
      return { content: [{ type: "text", text: result }] };
    }
  • The attach_debugger tool does not have a dedicated Zod schema; it directly accesses args.debug_mode as a string. The related DebuggerListenSchema (used by start/stop/get_session) is shown for context.
    const DebuggerListenSchema = z.object({
      terminal_id: z.string().optional(),
      ide_id: z.string().optional(),
      user: z.string().optional(),
    });
  • Helper guard that ensures a debug session is active before allowing debugger operations like attach. Throws an error if no session exists.
    private ensureDebugSession(): void {
      if (!this.debugSessionActive) {
        throw new Error("No active debug session. Call start_debugger_listener first.");
      }
    }
Behavior2/5

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

With no annotations, the description carries full burden. It does not disclose behavioral traits like whether it requires an existing debugger listener, side effects, or error conditions. The minimal description is insufficient for an agent to understand the tool's behavior.

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?

The description is a single, concise sentence that immediately communicates the tool's purpose. No extraneous information.

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

Completeness2/5

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

Given the tool's complexity (debugger attachment), the lack of output schema, and no annotations, the description is incomplete. It does not explain return values, prerequisites, or behavior when no session is running.

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%, and the description adds no additional meaning beyond what the schema already provides for debug_mode and system_id. 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 action ('attach the debugger') and the target ('to a running ABAP session'). It is specific and distinguishes itself from sibling debugger tools like debugger_step or set_debugger_breakpoint.

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?

No guidance is provided on when to use this tool versus alternatives such as start_debugger_listener or debugger_step. The description does not mention prerequisites or context 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