Skip to main content
Glama

trace_execution_path

Trace code execution paths across multiple files to understand complex call flows, identify issues, and assess technical debt with architectural insights.

Instructions

Trace execution path through multiple files starting from an entry point. Shows complete call flow with intelligent analysis and architectural insights.

WORKFLOW: Perfect for understanding complex code, identifying issues, and technical debt assessment TIP: Use Desktop Commander to read files, then pass content here for analysis SAVES: Claude context for strategic decisions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
analysisDepthNoLevel of analysis detaildetailed
analysisTypeNoType of analysis to performcomprehensive
codeNoThe code to analyze (for single-file analysis)
entryPointYesEntry point like ClassName::methodName or functionName
filePathNoPath to single file to analyze
filesNoArray of specific file paths (for multi-file analysis)
languageNoProgramming languagejavascript
maxDepthNoMaximum directory depth for multi-file discovery (1-5)
projectPathNoPath to project root (for multi-file analysis)
showParametersNoInclude parameter information in trace
traceDepthNoMaximum depth to trace (1-10)

Implementation Reference

  • Core handler function that implements the trace_execution_path tool logic. Handles security wrapping, parameter validation, mode detection (single/multi-file), model setup, and dispatches to specialized analysis methods.
    async execute(params: any, llmClient: any) { return await withSecurity(this, params, llmClient, async (secureParams) => { try { // 1. Auto-detect analysis mode based on parameters const analysisMode = this.detectAnalysisMode(secureParams); // 2. Validate parameters based on detected mode this.validateParameters(secureParams, analysisMode); // 3. Setup model const { model, contextLength } = await ModelSetup.getReadyModel(llmClient); // 4. Route to appropriate analysis method if (analysisMode === 'single-file') { return await this.executeSingleFileAnalysis(secureParams, model, contextLength); } else { return await this.executeMultiFileAnalysis(secureParams, model, contextLength); } } catch (error: any) { return ErrorHandler.createExecutionError('trace_execution_path', error); } }); }
  • Output schema definition (TraceExecutionPathResponse) for the trace_execution_path tool response validation.
    export interface TraceExecutionPathResponse extends BaseResponse { data: { trace: Array<{ level: number; file: string; function: string; line: number; parameters?: string[]; calls: Array<{ function: string; file: string; line: number; }>; }>; summary: { totalCalls: number; uniqueFunctions: number; filesInvolved: string[]; maxDepthReached: boolean; }; visualization: string; }; }
  • Input parameter schema definition for the trace_execution_path tool, supporting both single-file and multi-file analysis modes with execution tracing specifics.
    parameters = { // Single-file parameters code: { type: 'string' as const, description: 'The code to analyze (for single-file analysis)', required: false }, filePath: { type: 'string' as const, description: 'Path to single file to analyze', required: false }, // Multi-file parameters projectPath: { type: 'string' as const, description: 'Path to project root (for multi-file analysis)', required: false }, files: { type: 'array' as const, description: 'Array of specific file paths (for multi-file analysis)', required: false, items: { type: 'string' as const } }, maxDepth: { type: 'number' as const, description: 'Maximum directory depth for multi-file discovery (1-5)', required: false, default: 3 }, // Execution tracing specific parameters entryPoint: { type: 'string' as const, description: 'Entry point like ClassName::methodName or functionName', required: true }, traceDepth: { type: 'number' as const, description: 'Maximum depth to trace (1-10)', required: false, default: 5 }, showParameters: { type: 'boolean' as const, description: 'Include parameter information in trace', required: false, default: false }, // Universal parameters language: { type: 'string' as const, description: 'Programming language', required: false, default: 'javascript' }, analysisDepth: { type: 'string' as const, description: 'Level of analysis detail', enum: ['basic', 'detailed', 'comprehensive'], default: 'detailed', required: false }, analysisType: { type: 'string' as const, description: 'Type of analysis to perform', enum: ['execution-flow', 'call-graph', 'comprehensive'], default: 'comprehensive', required: false } };
  • Plugin class declaration with tool name 'trace_execution_path', category, and description - serves as the tool registration.
    export class ExecutionPathTracer extends BasePlugin implements IPromptPlugin { name = 'trace_execution_path'; category = 'analyze' as const; description = 'Trace execution path through multiple files starting from an entry point. Shows complete call flow with intelligent analysis and architectural insights.';

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/houtini-ai/lm'

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