get_debugger_variables
Inspect variable values in the current ABAP debug session by providing variable names. Returns value statements for each variable.
Instructions
Get variable values in the current debug context. Returns value statements for each variable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| variable_names | Yes | Array of variable names to inspect | |
| system_id | No | SAP system ID (e.g. DEV). Omit to use default system. |
Implementation Reference
- src/adt-client.ts:536-549 (handler)Core handler: debuggerGetVariables sends a POST to /sap/bc/adt/debugger?method=getVariables with an XML payload of requested variable names, returns the raw response data.
async debuggerGetVariables(variableNames: string[]): Promise<string> { this.ensureDebugSession(); const items = variableNames.map(n => `<dbg:variable><dbg:name>${this.escapeXml(n)}</dbg:name></dbg:variable>`).join(""); const xml = `<?xml version="1.0" encoding="UTF-8"?> <dbg:variableRequests xmlns:dbg="http://www.sap.com/adt/debugger">${items}</dbg:variableRequests>`; const resp = await this.http.post("/sap/bc/adt/debugger?method=getVariables", xml, { headers: this.statefulHeaders({ "Content-Type": "application/xml", Accept: "application/xml", }), responseType: "text", }); return resp.data as string; } - src/mcp-server.ts:735-745 (registration)Registration: Tool 'get_debugger_variables' registered in the MCP server's ListToolsRequestSchema handler with its input schema.
name: "get_debugger_variables", description: "Get variable values in the current debug context. Returns value statements for each variable.", inputSchema: { type: "object" as const, properties: { variable_names: { type: "array", description: "Array of variable names to inspect" }, ...SYSTEM_ID_PROP, }, required: ["variable_names"], }, }, - src/mcp-server.ts:152-152 (schema)Schema definition: DebuggerVariablesSchema defines the input validation for 'get_debugger_variables' requiring an array of variable name strings.
const DebuggerVariablesSchema = z.object({ variable_names: z.array(z.string()) }); - src/mcp-server.ts:1238-1242 (handler)Handler routing: The CallToolRequestSchema dispatches 'get_debugger_variables' by parsing args with DebuggerVariablesSchema and calling client.debuggerGetVariables().
case "get_debugger_variables": { const { variable_names } = DebuggerVariablesSchema.parse(args); const result = await client.debuggerGetVariables(variable_names); return { content: [{ type: "text", text: result }] }; }