Skip to main content
Glama

RuntimeGetProfilerTraceData

Retrieve profiler trace data by trace ID or URI, returning parsed JSON for hitlist, statements, or database accesses.

Instructions

[runtime] Read profiler trace data by trace id/uri: hitlist, statements, or db accesses. Returns parsed JSON payload.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
trace_id_or_uriYesProfiler trace ID or full ADT trace URI.
viewYesTrace view to retrieve.
with_system_eventsNoInclude system events.
idNoStatement node ID (for statements view).
with_detailsNoInclude statement details (for statements view).
auto_drill_down_thresholdNoAuto drill-down threshold (for statements view).

Implementation Reference

  • Main handler function that reads profiler trace data from an ADT system. Uses AdtRuntimeClient to fetch hitlist, statements, or db_accesses views based on args.view. Returns parsed JSON payload via return_response.
    export async function handleRuntimeGetProfilerTraceData(
      context: HandlerContext,
      args: RuntimeGetProfilerTraceDataArgs,
    ) {
      const { connection, logger } = context;
    
      try {
        if (!args?.trace_id_or_uri) {
          throw new Error('Parameter "trace_id_or_uri" is required');
        }
    
        const runtimeClient = new AdtRuntimeClient(connection, logger);
        const profiler = runtimeClient.getProfiler();
        const response =
          args.view === 'hitlist'
            ? await profiler.getHitList(args.trace_id_or_uri, {
                withSystemEvents: args.with_system_events,
              })
            : args.view === 'statements'
              ? await profiler.getStatements(args.trace_id_or_uri, {
                  id: args.id,
                  withDetails: args.with_details,
                  autoDrillDownThreshold: args.auto_drill_down_threshold,
                  withSystemEvents: args.with_system_events,
                })
              : await profiler.getDbAccesses(args.trace_id_or_uri, {
                  withSystemEvents: args.with_system_events,
                });
    
        return return_response({
          data: JSON.stringify(
            {
              success: true,
              view: args.view,
              trace_id_or_uri: args.trace_id_or_uri,
              status: response.status,
              payload: parseRuntimePayloadToJson(response.data),
            },
            null,
            2,
          ),
          status: response.status,
          statusText: response.statusText,
          headers: response.headers,
          config: response.config,
        });
      } catch (error: any) {
        logger?.error('Error reading profiler trace data:', error);
        return return_error(error);
      }
    }
  • TypeScript interface defining the input args for the tool: trace_id_or_uri, view (hitlist|statements|db_accesses), and optional parameters like with_system_events, id, with_details, auto_drill_down_threshold.
    interface RuntimeGetProfilerTraceDataArgs {
      trace_id_or_uri: string;
      view: 'hitlist' | 'statements' | 'db_accesses';
      with_system_events?: boolean;
      id?: number;
      with_details?: boolean;
      auto_drill_down_threshold?: number;
    }
  • TOOL_DEFINITION constant exporting the tool name 'RuntimeGetProfilerTraceData', availability (onprem/cloud), description, and JSON Schema input schema with properties like trace_id_or_uri, view, with_system_events, id, with_details, auto_drill_down_threshold.
    export const TOOL_DEFINITION = {
      name: 'RuntimeGetProfilerTraceData',
      available_in: ['onprem', 'cloud'] as const,
      description:
        '[runtime] Read profiler trace data by trace id/uri: hitlist, statements, or db accesses. Returns parsed JSON payload.',
      inputSchema: {
        type: 'object',
        properties: {
          trace_id_or_uri: {
            type: 'string',
            description: 'Profiler trace ID or full ADT trace URI.',
          },
          view: {
            type: 'string',
            enum: ['hitlist', 'statements', 'db_accesses'],
            description: 'Trace view to retrieve.',
          },
          with_system_events: {
            type: 'boolean',
            description: 'Include system events.',
          },
          id: {
            type: 'number',
            description: 'Statement node ID (for statements view).',
          },
          with_details: {
            type: 'boolean',
            description: 'Include statement details (for statements view).',
          },
          auto_drill_down_threshold: {
            type: 'number',
            description: 'Auto drill-down threshold (for statements view).',
          },
        },
        required: ['trace_id_or_uri', 'view'],
      },
    } as const;
  • Handler entry in SystemHandlersGroup that maps RuntimeGetProfilerTraceData_Tool to handleRuntimeGetProfilerTraceData(this.context, args).
    {
      toolDefinition: RuntimeGetProfilerTraceData_Tool,
      handler: (args: any) =>
        handleRuntimeGetProfilerTraceData(this.context, args),
    },
  • Compact handler 'HandlerProfileView' that delegates to handleRuntimeGetProfilerTraceData, reusing the same logic.
    export async function handleHandlerProfileView(
      context: HandlerContext,
      args: HandlerProfileViewArgs,
    ) {
      return handleRuntimeGetProfilerTraceData(context, args);
    }
Behavior3/5

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

No annotations provided, so description carries burden. It states it returns parsed JSON payload, implying a read-only operation. However, it doesn't disclose potential side effects or authentication requirements. Adequate but not thorough.

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?

Single sentence front-loaded with purpose and key details. No wasted words; every part serves a purpose.

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

Completeness3/5

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

Given 6 parameters and no output schema, the description provides the essential purpose and return format but lacks details on parameter interactions or result structure. Adequate but not fully complete.

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

Parameters3/5

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

Schema coverage is 100% with descriptions for all 6 parameters. The description adds minimal extra meaning beyond hinting at views and return format. Baseline 3 is appropriate.

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

Purpose4/5

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

The description clearly states the verb 'Read' and resource 'profiler trace data', specifying the scope (by trace id/uri) and possible views (hitlist, statements, db accesses). It distinguishes from siblings like RuntimeAnalyzeProfilerTrace, though not explicitly.

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 guidance on when to use this tool versus alternatives (e.g., RuntimeAnalyzeProfilerTrace). The description does not mention conditions or exclusions.

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