get_st05_trace_state
Retrieve the current ST05 performance trace state, showing active trace types, user filter, and server information.
Instructions
Get the current ST05 performance trace state — shows which trace types are active, the user filter, and server info.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| system_id | No | SAP system ID (e.g. DEV). Omit to use default system. |
Implementation Reference
- src/mcp-server.ts:1378-1407 (handler)Handler for 'get_st05_trace_state' tool that fetches ST05 trace state from the SAP system via client.getSt05TraceState(), parses the XML response to extract trace type statuses (SQL, buffer, enqueue, RFC, HTTP, auth, stack), server info, user filter, modification info, and returns a formatted text response showing whether trace is ACTIVE or INACTIVE.
case "get_st05_trace_state": { const state = await client.getSt05TraceState(); const sqlOn = state.match(/<ts:sqlOn>(\w+)<\/ts:sqlOn>/)?.[1]; const bufOn = state.match(/<ts:bufOn>(\w+)<\/ts:bufOn>/)?.[1]; const enqOn = state.match(/<ts:enqOn>(\w+)<\/ts:enqOn>/)?.[1]; const rfcOn = state.match(/<ts:rfcOn>(\w+)<\/ts:rfcOn>/)?.[1]; const httpOn = state.match(/<ts:httpOn>(\w+)<\/ts:httpOn>/)?.[1]; const authOn = state.match(/<ts:authOn>(\w+)<\/ts:authOn>/)?.[1]; const stackOn = state.match(/<ts:stackTraceOn>(\w+)<\/ts:stackTraceOn>/)?.[1]; const traceUser = state.match(/<ts:traceUser>([^<]*)<\/ts:traceUser>/)?.[1] || "(none)"; const selected = state.match(/<ts:isSelected>(\w+)<\/ts:isSelected>/)?.[1]; const instance = state.match(/<ts:instance>([^<]+)<\/ts:instance>/)?.[1]; const modUser = state.match(/<ts:modificationUser>([^<]*)<\/ts:modificationUser>/)?.[1]; const modTime = state.match(/<ts:modificationDateTime>([^<]*)<\/ts:modificationDateTime>/)?.[1]; const active = selected === "true" && (sqlOn === "true" || bufOn === "true" || enqOn === "true" || rfcOn === "true" || httpOn === "true" || authOn === "true"); const lines = [ `ST05 trace state: ${active ? "ACTIVE" : "INACTIVE"}`, ` Server: ${instance}`, ` User filter: ${traceUser}`, ` SQL: ${sqlOn}`, ` Buffer: ${bufOn}`, ` Enqueue: ${enqOn}`, ` RFC: ${rfcOn}`, ` HTTP: ${httpOn}`, ` Auth: ${authOn}`, ` Stack trace: ${stackOn}`, ` Modified by: ${modUser} at ${modTime}`, ]; return { content: [{ type: "text", text: lines.join("\n") }] }; } - src/mcp-server.ts:862-868 (schema)Schema/registration for 'get_st05_trace_state' tool in the ListToolsRequestSchema handler. Takes only optional system_id. No dedicated Zod schema needed since only SYSTEM_ID_PROP is used.
name: "get_st05_trace_state", description: "Get the current ST05 performance trace state — shows which trace types are active, the user filter, and server info.", inputSchema: { type: "object" as const, properties: { ...SYSTEM_ID_PROP }, required: [], }, - src/adt-client.ts:1447-1453 (helper)Helper method in AdtClient that performs the actual HTTP GET request to the SAP ADT endpoint /sap/bc/adt/st05/trace/state to retrieve the ST05 performance trace state XML.
async getSt05TraceState(): Promise<string> { const response = await this.http.get<string>( "/sap/bc/adt/st05/trace/state", { headers: { Accept: "*/*" }, responseType: "text" } ); return response.data; }