RuntimeCreateProfilerTraceParameters
Creates ABAP profiler trace parameters with user-defined settings and returns a profilerId to initiate profiled execution for performance analysis.
Instructions
[runtime] Create ABAP profiler trace parameters and return profilerId (URI) for profiled execution.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | Yes | Human-readable trace description. | |
| all_misc_abap_statements | No | ||
| all_procedural_units | No | ||
| all_internal_table_events | No | ||
| all_dynpro_events | No | ||
| aggregate | No | ||
| explicit_on_off | No | ||
| with_rfc_tracing | No | ||
| all_system_kernel_events | No | ||
| sql_trace | No | ||
| all_db_events | No | ||
| max_size_for_trace_file | No | ||
| amdp_trace | No | ||
| max_time_for_tracing | No |
Implementation Reference
- Main handler function that creates ABAP profiler trace parameters. Uses AdtRuntimeClient to get the profiler, calls createParameters with the provided args, extracts the profilerId from the response, and returns success data with the profiler_id.
export async function handleRuntimeCreateProfilerTraceParameters( context: HandlerContext, args: RuntimeCreateProfilerTraceParametersArgs, ) { const { connection, logger } = context; try { if (!args?.description) { throw new Error('Parameter "description" is required'); } const runtimeClient = new AdtRuntimeClient(connection, logger); const profiler = runtimeClient.getProfiler(); const response = await profiler.createParameters({ description: args.description, allMiscAbapStatements: args.all_misc_abap_statements, allProceduralUnits: args.all_procedural_units, allInternalTableEvents: args.all_internal_table_events, allDynproEvents: args.all_dynpro_events, aggregate: args.aggregate, explicitOnOff: args.explicit_on_off, withRfcTracing: args.with_rfc_tracing, allSystemKernelEvents: args.all_system_kernel_events, sqlTrace: args.sql_trace, allDbEvents: args.all_db_events, maxSizeForTraceFile: args.max_size_for_trace_file, amdpTrace: args.amdp_trace, maxTimeForTracing: args.max_time_for_tracing, }); const profilerId = (profiler as Profiler).extractIdFromResponse(response); return return_response({ data: JSON.stringify( { success: true, profiler_id: profilerId, status: response.status, }, null, 2, ), status: response.status, statusText: response.statusText, headers: response.headers, config: response.config, }); } catch (error: any) { logger?.error('Error creating profiler trace parameters:', error); return return_error(error); } } - TOOL_DEFINITION constant defining the tool's name ('RuntimeCreateProfilerTraceParameters'), availability ('onprem', 'cloud'), description, and inputSchema with properties like description (required), various boolean trace flags, and numeric size/time limits.
export const TOOL_DEFINITION = { name: 'RuntimeCreateProfilerTraceParameters', available_in: ['onprem', 'cloud'] as const, description: '[runtime] Create ABAP profiler trace parameters and return profilerId (URI) for profiled execution.', inputSchema: { type: 'object', properties: { description: { type: 'string', description: 'Human-readable trace description.', }, all_misc_abap_statements: { type: 'boolean' }, all_procedural_units: { type: 'boolean' }, all_internal_table_events: { type: 'boolean' }, all_dynpro_events: { type: 'boolean' }, aggregate: { type: 'boolean' }, explicit_on_off: { type: 'boolean' }, with_rfc_tracing: { type: 'boolean' }, all_system_kernel_events: { type: 'boolean' }, sql_trace: { type: 'boolean' }, all_db_events: { type: 'boolean' }, max_size_for_trace_file: { type: 'number' }, amdp_trace: { type: 'boolean' }, max_time_for_tracing: { type: 'number' }, }, required: ['description'], }, } as const; - TypeScript interface defining the strongly-typed args for the handler, mapping the snake_case input schema properties to their expected types.
interface RuntimeCreateProfilerTraceParametersArgs { description: string; all_misc_abap_statements?: boolean; all_procedural_units?: boolean; all_internal_table_events?: boolean; all_dynpro_events?: boolean; aggregate?: boolean; explicit_on_off?: boolean; with_rfc_tracing?: boolean; all_system_kernel_events?: boolean; sql_trace?: boolean; all_db_events?: boolean; max_size_for_trace_file?: number; amdp_trace?: boolean; max_time_for_tracing?: number; } - src/lib/handlers/groups/SystemHandlersGroup.ts:132-136 (registration)Registration of the tool in SystemHandlersGroup.getHandlers(). Uses RuntimeCreateProfilerTraceParameters_Tool as the toolDefinition and wires it to handleRuntimeCreateProfilerTraceParameters.
{ toolDefinition: RuntimeCreateProfilerTraceParameters_Tool, handler: (args: any) => handleRuntimeCreateProfilerTraceParameters(this.context, args), }, - src/lib/handlers/groups/SystemHandlersGroup.ts:73-76 (registration)Import of the handler function and TOOL_DEFINITION (aliased as RuntimeCreateProfilerTraceParameters_Tool) from the handler file.
import { handleRuntimeCreateProfilerTraceParameters, TOOL_DEFINITION as RuntimeCreateProfilerTraceParameters_Tool, } from '../../../handlers/system/readonly/handleRuntimeCreateProfilerTraceParameters';