disable_st05_trace
Stop all active ST05 performance trace collection on the SAP server, ending performance monitoring to free system resources.
Instructions
Disable ST05 performance trace. Stops all active trace collection on the server.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| system_id | No | SAP system ID (e.g. DEV). Omit to use default system. |
Implementation Reference
- src/adt-client.ts:1518-1576 (handler)Core handler that disables the ST05 trace. Reads current state, then sends an XML PUT request to /sap/bc/adt/st05/trace/state with all trace types set to false and isSelected=false, effectively stopping all trace collection.
async disableSt05Trace(): Promise<string> { const state = await this.getSt05TraceState(); const instanceMatch = state.match(/<ts:instance>([^<]+)<\/ts:instance>/); const hostMatch = state.match(/<ts:host>([^<]+)<\/ts:host>/); const instance = instanceMatch?.[1] ?? ""; const host = hostMatch?.[1] ?? ""; const xml = `<?xml version="1.0" encoding="UTF-8"?> <ts:traceStateInstanceTable xmlns:ts="http://www.sap.com/adt/tools/performance/tracestate"> <ts:traceStateInstance> <ts:instance>${this.escapeXml(instance)}</ts:instance> <ts:host>${this.escapeXml(host)}</ts:host> <ts:isLocal>true</ts:isLocal> <ts:isSelected>false</ts:isSelected> <ts:modificationUser>${this.escapeXml(this.config.username.toUpperCase())}</ts:modificationUser> <ts:modificationDateTime>${new Date().toISOString().replace(/\.\d+Z$/, "Z")}</ts:modificationDateTime> <ts:traceTypes> <ts:sqlOn>false</ts:sqlOn> <ts:bufOn>false</ts:bufOn> <ts:enqOn>false</ts:enqOn> <ts:rfcOn>false</ts:rfcOn> <ts:httpOn>false</ts:httpOn> <ts:apcOn>false</ts:apcOn> <ts:amcOn>false</ts:amcOn> <ts:authOn>false</ts:authOn> </ts:traceTypes> <ts:traceProperties> <ts:includeMissingTableNameOn>false</ts:includeMissingTableNameOn> <ts:authErrorsOnly>false</ts:authErrorsOnly> <ts:stackTraceOn>false</ts:stackTraceOn> <ts:includedTables/> <ts:excludedTables/> </ts:traceProperties> <ts:traceFilter> <ts:traceUser/> <ts:transactionCode/> <ts:program/> <ts:rfcFunction/> <ts:url/> <ts:wpId/> </ts:traceFilter> </ts:traceStateInstance> </ts:traceStateInstanceTable>`; return (await this.putWithCsrf( "/sap/bc/adt/st05/trace/state", xml, "application/vnd.sap.adt.perf.trace.state.v1+xml", "application/vnd.sap.adt.perf.trace.state.v1+xml" )).data as string; } private escapeXml(s: string): string { return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """); } private async fetchCsrfToken(): Promise<void> { const response = await this.http.get("/sap/bc/adt/discovery", { - src/mcp-server.ts:1373-1376 (handler)MCP tool handler in the switch statement that routes disable_st05_trace calls to the AdtClient.disableSt05Trace() method.
case "disable_st05_trace": { await client.disableSt05Trace(); return { content: [{ type: "text", text: "ST05 trace disabled." }] }; } - src/mcp-server.ts:852-860 (registration)Tool registration in the ListToolsRequestSchema handler. Defines the tool name, description, and input schema (only optional system_id).
{ name: "disable_st05_trace", description: "Disable ST05 performance trace. Stops all active trace collection on the server.", inputSchema: { type: "object" as const, properties: { ...SYSTEM_ID_PROP }, required: [], }, }, - src/adt-client.ts:1447-1453 (helper)Helper method that fetches the current ST05 trace state from the SAP server, used by disableSt05Trace() to read the current instance/host info before sending the disable request.
async getSt05TraceState(): Promise<string> { const response = await this.http.get<string>( "/sap/bc/adt/st05/trace/state", { headers: { Accept: "*/*" }, responseType: "text" } ); return response.data; }