create_trace_config
Create an ABAP runtime trace configuration to capture traces for a specific program, transaction, or other object. Specify object name, process type, and execution limit to diagnose performance issues.
Instructions
Create a trace collection configuration to capture an ABAP runtime trace
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| object_name | Yes | Object name to trace (e.g. program or transaction) | |
| process_type | No | Process type: HTTP, DIALOG, RFC, etc. (default: any) | |
| description | No | Description for the trace configuration | |
| max_executions | No | Maximum number of executions to capture (default: 10) | |
| object_type | No | Object type: any, report, transaction, functionmodule, url (default: any) | |
| system_id | No | SAP system ID (e.g. DEV). Omit to use default system. |
Implementation Reference
- src/mcp-server.ts:591-606 (registration)Tool registration: 'create_trace_config' is listed in the ListToolsRequestSchema handler with its name, description, and input schema.
{ name: "create_trace_config", description: "Create a trace collection configuration to capture an ABAP runtime trace", inputSchema: { type: "object" as const, properties: { object_name: { type: "string", description: "Object name to trace (e.g. program or transaction)" }, process_type: { type: "string", description: "Process type: HTTP, DIALOG, RFC, etc. (default: any)" }, description: { type: "string", description: "Description for the trace configuration" }, max_executions: { type: "number", description: "Maximum number of executions to capture (default: 10)" }, object_type: { type: "string", description: "Object type: any, report, transaction, functionmodule, url (default: any)" }, ...SYSTEM_ID_PROP, }, required: ["object_name"], }, }, - src/mcp-server.ts:81-87 (schema)Zod schema CreateTraceConfigSchema defines the input validation for create_trace_config: object_name (required), process_type, description, max_executions, object_type (all optional).
const CreateTraceConfigSchema = z.object({ object_name: z.string(), process_type: z.string().optional(), description: z.string().optional(), max_executions: z.number().optional(), object_type: z.string().optional(), }); - src/mcp-server.ts:1171-1175 (handler)Handler logic for create_trace_config in the CallToolRequestSchema: parses args with CreateTraceConfigSchema, then calls client.createTraceConfig() with the parsed parameters and returns the result.
case "create_trace_config": { const { object_name, process_type, description, max_executions, object_type } = CreateTraceConfigSchema.parse(args); const result = await client.createTraceConfig(object_name, process_type, description, max_executions, object_type); return { content: [{ type: "text", text: result }] }; } - src/adt-client.ts:273-292 (helper)Actual implementation: AdtClient.createTraceConfig() method that builds URLSearchParams with objectName, processType (default 'any'), description (default ''), maximalExecutions (default 10), objectType (default 'any'), and sends a POST request to the SAP ADT runtime traces endpoint.
async createTraceConfig(objectName: string, processType = "any", description = "", maxExecutions = 10, objectType = "any"): Promise<string> { const processTypeUri = processType.startsWith("/sap/") ? processType : `/sap/bc/adt/runtime/traces/abaptraces/processtypes/${processType}`; const objectTypeUri = objectType.startsWith("/sap/") ? objectType : `/sap/bc/adt/runtime/traces/abaptraces/objecttypes/${objectType}`; const params = new URLSearchParams({ objectName, objectType: objectTypeUri, processType: processTypeUri, description, maximalExecutions: String(maxExecutions), }); return (await this.postWithCsrf( `/sap/bc/adt/runtime/traces/abaptraces/requests?${params.toString()}`, "", "*/*" )).data as string; }