Skip to main content
Glama

RuntimeAnalyzeProfilerTrace

Read a profiler trace to get a compact analysis summary with totals and top entries by view (hitlist, statements, or database accesses).

Instructions

[runtime] Read profiler trace view and return compact analysis summary (totals + top entries).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
trace_id_or_uriYesProfiler trace ID or full trace URI.
viewNohitlist
topNoNumber of top rows for summary. Default: 10.
with_system_eventsNoInclude system events.

Implementation Reference

  • Main handler function that executes the tool logic: reads profiler trace (hitlist, statements, or db_accesses) via AdtRuntimeClient, parses the response, and returns a compact analysis summary with top entries.
    export async function handleRuntimeAnalyzeProfilerTrace(
      context: HandlerContext,
      args: RuntimeAnalyzeProfilerTraceArgs,
    ) {
      const { connection, logger } = context;
    
      try {
        if (!args?.trace_id_or_uri) {
          throw new Error('Parameter "trace_id_or_uri" is required');
        }
    
        const view = args.view ?? 'hitlist';
        const runtimeClient = new AdtRuntimeClient(connection, logger);
        const profiler = runtimeClient.getProfiler();
        const response =
          view === 'hitlist'
            ? await profiler.getHitList(args.trace_id_or_uri, {
                withSystemEvents: args.with_system_events,
              })
            : view === 'statements'
              ? await profiler.getStatements(args.trace_id_or_uri, {
                  withSystemEvents: args.with_system_events,
                })
              : await profiler.getDbAccesses(args.trace_id_or_uri, {
                  withSystemEvents: args.with_system_events,
                });
    
        const parsedPayload = parseRuntimePayloadToJson(response.data);
        const summary = pickTopEntries(parsedPayload, args.top ?? 10);
    
        return return_response({
          data: JSON.stringify(
            {
              success: true,
              trace_id_or_uri: args.trace_id_or_uri,
              view,
              status: response.status,
              summary,
              payload: parsedPayload,
            },
            null,
            2,
          ),
          status: response.status,
          statusText: response.statusText,
          headers: response.headers,
          config: response.config,
        });
      } catch (error: unknown) {
        logger?.error('Error analyzing profiler trace:', error);
        return return_error(error);
      }
    }
  • TOOL_DEFINITION export containing the tool name 'RuntimeAnalyzeProfilerTrace', availability (onprem/cloud), description, and inputSchema with parameters trace_id_or_uri (required), view, top, with_system_events.
    export const TOOL_DEFINITION = {
      name: 'RuntimeAnalyzeProfilerTrace',
      available_in: ['onprem', 'cloud'] as const,
      description:
        '[runtime] Read profiler trace view and return compact analysis summary (totals + top entries).',
      inputSchema: {
        type: 'object',
        properties: {
          trace_id_or_uri: {
            type: 'string',
            description: 'Profiler trace ID or full trace URI.',
          },
          view: {
            type: 'string',
            enum: ['hitlist', 'statements', 'db_accesses'],
            default: 'hitlist',
          },
          top: {
            type: 'number',
            description: 'Number of top rows for summary. Default: 10.',
          },
          with_system_events: {
            type: 'boolean',
            description: 'Include system events.',
          },
        },
        required: ['trace_id_or_uri'],
      },
    } as const;
  • TypeScript interface RuntimeAnalyzeProfilerTraceArgs defining the typed arguments for the handler.
    interface RuntimeAnalyzeProfilerTraceArgs {
      trace_id_or_uri: string;
      view?: 'hitlist' | 'statements' | 'db_accesses';
      top?: number;
      with_system_events?: boolean;
    }
  • Import of handleRuntimeAnalyzeProfilerTrace function and its TOOL_DEFINITION aliased as RuntimeAnalyzeProfilerTrace_Tool from the handler file.
    import {
      handleRuntimeAnalyzeProfilerTrace,
      TOOL_DEFINITION as RuntimeAnalyzeProfilerTrace_Tool,
    } from '../../../handlers/system/readonly/handleRuntimeAnalyzeProfilerTrace';
  • Registration of the tool in SystemHandlersGroup: maps the toolDefinition to the handler that calls handleRuntimeAnalyzeProfilerTrace(this.context, args).
    {
      toolDefinition: RuntimeAnalyzeProfilerTrace_Tool,
      handler: (args: any) =>
        handleRuntimeAnalyzeProfilerTrace(this.context, args),
    },
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It indicates a read operation ('Read'), implying safety, but does not disclose other behavioral traits like side effects, authentication, or error handling. Adequate but minimal.

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, front-loaded sentence with a tag and clear action. No unnecessary words, and every element serves a purpose.

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

Completeness4/5

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

Despite the lack of an output schema, the description explains what is returned (totals + top entries). It covers the main purpose and the key parameter (trace_id_or_uri). However, it could benefit from noting that the output is likely JSON or a structured format.

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 description coverage is 75% (3 of 4 params described). The tool description does not add any additional parameter meaning beyond the schema. The 'view' parameter lacks a description in the schema, and the tool description does not compensate for that gap.

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 verb 'Read', the resource 'profiler trace view', and the output 'compact analysis summary (totals + top entries)'. It is distinct from sibling tools like RuntimeGetProfilerTraceData (raw data) and RuntimeCreateProfilerTraceParameters (creation).

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

Usage Guidelines3/5

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

The description implies usage for obtaining a summary, but does not explicitly state when to use it vs. alternatives (e.g., when raw data is needed). No exclusions or alternative names are mentioned.

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