Skip to main content
Glama

RuntimeRunClassWithProfiling

Execute an ABAP class with the profiler enabled to capture performance data, returning a unique profiler ID and trace ID for analysis.

Instructions

[runtime] Execute ABAP class with profiler enabled and return created profilerId + traceId.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
class_nameYesABAP class name to execute.
descriptionNoProfiler trace description.
all_procedural_unitsNo
all_misc_abap_statementsNo
all_internal_table_eventsNo
all_dynpro_eventsNo
aggregateNo
explicit_on_offNo
with_rfc_tracingNo
all_system_kernel_eventsNo
sql_traceNo
all_db_eventsNo
max_size_for_trace_fileNo
amdp_traceNo
max_time_for_tracingNo

Implementation Reference

  • Main handler function that executes ABAP class with profiling. Uses AdtExecutor to run the class with profiler parameters and returns profilerId + traceId.
    export async function handleRuntimeRunClassWithProfiling(
      context: HandlerContext,
      args: RuntimeRunClassWithProfilingArgs,
    ) {
      const { connection, logger } = context;
    
      try {
        if (!args?.class_name) {
          throw new Error('Parameter "class_name" is required');
        }
    
        const className = args.class_name.trim().toUpperCase();
        const executor = new AdtExecutor(connection, logger);
        const classExecutor = executor.getClassExecutor();
    
        const result = await classExecutor.runWithProfiling(
          { className },
          {
            profilerParameters: {
              description: args.description,
              allProceduralUnits: args.all_procedural_units,
              allMiscAbapStatements: args.all_misc_abap_statements,
              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,
            },
          },
        );
    
        return return_response({
          data: JSON.stringify(
            {
              success: true,
              class_name: className,
              profiler_id: result.profilerId,
              trace_id: result.traceId,
              run_status: result.response?.status,
              trace_requests_status: result.traceRequestsResponse?.status,
            },
            null,
            2,
          ),
          status: result.response?.status,
          statusText: result.response?.statusText,
          headers: result.response?.headers,
          config: result.response?.config,
        });
      } catch (error: any) {
        logger?.error('Error running class with profiling:', error);
        return return_error(error);
      }
    }
  • Tool definition and input schema for RuntimeRunClassWithProfiling. Defines name, description, available_in, and inputSchema with all profiler-related parameters.
    export const TOOL_DEFINITION = {
      name: 'RuntimeRunClassWithProfiling',
      available_in: ['onprem', 'cloud'] as const,
      description:
        '[runtime] Execute ABAP class with profiler enabled and return created profilerId + traceId.',
      inputSchema: {
        type: 'object',
        properties: {
          class_name: {
            type: 'string',
            description: 'ABAP class name to execute.',
          },
          description: {
            type: 'string',
            description: 'Profiler trace description.',
          },
          all_procedural_units: { type: 'boolean' },
          all_misc_abap_statements: { 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: ['class_name'],
      },
    } as const;
  • Import of handleRuntimeRunClassWithProfiling and its TOOL_DEFINITION into SystemHandlersGroup.
    import {
      handleRuntimeRunClassWithProfiling,
      TOOL_DEFINITION as RuntimeRunClassWithProfiling_Tool,
    } from '../../../handlers/system/readonly/handleRuntimeRunClassWithProfiling';
  • Registration of RuntimeRunClassWithProfiling tool in SystemHandlersGroup's getHandlers() method, mapping toolDefinition to handler.
    {
      toolDefinition: RuntimeRunClassWithProfiling_Tool,
      handler: (args: any) =>
        handleRuntimeRunClassWithProfiling(this.context, args),
    },
  • Higher-level HandlerProfileRun tool that delegates to handleRuntimeRunClassWithProfiling when target_type is CLASS.
    export async function handleHandlerProfileRun(
      context: HandlerContext,
      args: HandlerProfileRunArgs,
    ) {
      if (args.target_type === 'CLASS') {
        if (!args.class_name) {
          throw new Error('class_name is required when target_type is CLASS');
        }
        return handleRuntimeRunClassWithProfiling(context, {
          class_name: args.class_name,
          description: args.description,
          all_procedural_units: args.all_procedural_units,
          all_misc_abap_statements: args.all_misc_abap_statements,
          all_internal_table_events: args.all_internal_table_events,
          all_dynpro_events: args.all_dynpro_events,
          aggregate: args.aggregate,
          explicit_on_off: args.explicit_on_off,
          with_rfc_tracing: args.with_rfc_tracing,
          all_system_kernel_events: args.all_system_kernel_events,
          sql_trace: args.sql_trace,
          all_db_events: args.all_db_events,
          max_size_for_trace_file: args.max_size_for_trace_file,
          amdp_trace: args.amdp_trace,
          max_time_for_tracing: args.max_time_for_tracing,
        });
      }
    
      if (!args.program_name) {
        throw new Error('program_name is required when target_type is PROGRAM');
      }
      return handleRuntimeRunProgramWithProfiling(context, {
        program_name: args.program_name,
        description: args.description,
        all_procedural_units: args.all_procedural_units,
        all_misc_abap_statements: args.all_misc_abap_statements,
        all_internal_table_events: args.all_internal_table_events,
        all_dynpro_events: args.all_dynpro_events,
        aggregate: args.aggregate,
        explicit_on_off: args.explicit_on_off,
        with_rfc_tracing: args.with_rfc_tracing,
        all_system_kernel_events: args.all_system_kernel_events,
        sql_trace: args.sql_trace,
        all_db_events: args.all_db_events,
        max_size_for_trace_file: args.max_size_for_trace_file,
        amdp_trace: args.amdp_trace,
        max_time_for_tracing: args.max_time_for_tracing,
      });
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, and the description only states the action and return values. It does not disclose side effects, authorization requirements, rate limits, or behavior on error (e.g., invalid class name). For a tool with 15 parameters, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence with no wasted words. It front-loads the core purpose and output, making it quick to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 15 parameters, no output schema, and no behavioral details, the description is far from complete. It does not explain how profiling works, what the returned IDs are used for, or how parameters affect tracing. A more detailed description is needed for proper use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is only 13%, yet the description adds no parameter-specific information. All parameters except class_name are left undefined, and the description does not clarify their meaning. Given the low coverage, the description should compensate but does not.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Execute ABAP class'), the resource ('with profiler enabled'), and the output ('profilerId + traceId'). It distinguishes this tool from siblings like RuntimeCreateProfilerTraceParameters or RuntimeAnalyzeProfilerTrace by specifying execution and return of IDs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No when-to-use or when-not-to-use guidance is provided. No alternatives are mentioned, and there is no context for when profiling is appropriate or what prerequisites exist.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fr0ster/mcp-abap-adt'

If you have feedback or need assistance with the MCP directory API, please join our Discord server