Skip to main content
Glama
haasonsaas

Deep Code Reasoning MCP Server

by haasonsaas

trace_execution_path

Analyze and trace code execution paths with semantic understanding, identifying data flows and dependencies to debug complex distributed systems efficiently.

Instructions

Use Gemini to perform deep execution analysis with semantic understanding

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entry_pointYes
include_data_flowNo
max_depthNo

Implementation Reference

  • The core handler function implementing the trace_execution_path tool logic. It reads the entry point file and related files, then uses GeminiService to perform execution trace analysis.
    async traceExecutionPath( entryPoint: CodeLocation, maxDepth: number = 10, _includeDataFlow: boolean = true, ): Promise<{ analysis: string; filesAnalyzed: string[]; }> { // Get code context around entry point const _context = await this.codeReader.readCodeContext(entryPoint, 100); // Find related files const relatedFiles = await this.codeReader.findRelatedFiles(entryPoint.file); const codeFiles = new Map<string, string>(); // Read entry point file codeFiles.set(entryPoint.file, await this.codeReader.readFile(entryPoint.file)); // Read related files up to maxDepth for (let i = 0; i < Math.min(relatedFiles.length, maxDepth); i++) { const content = await this.codeReader.readFile(relatedFiles[i]); codeFiles.set(relatedFiles[i], content); } // Use Gemini to trace execution const analysis = await this.geminiService.performExecutionTraceAnalysis( codeFiles, entryPoint, ); return { analysis, filesAnalyzed: Array.from(codeFiles.keys()), }; }
  • The MCP server request handler case for 'trace_execution_path'. Parses arguments using the schema, validates file paths, and delegates to DeepCodeReasonerV2.traceExecutionPath.
    case 'trace_execution_path': { const parsed = TraceExecutionPathSchema.parse(args); // Validate the entry point file path const validatedPath = InputValidator.validateFilePaths([parsed.entry_point.file])[0]; if (!validatedPath) { throw new McpError( ErrorCode.InvalidParams, 'Invalid entry point file path', ); } const result = await deepReasoner.traceExecutionPath( { ...parsed.entry_point, file: validatedPath }, parsed.max_depth, parsed.include_data_flow, ); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • Zod schema defining the input structure for the trace_execution_path tool, including entry_point, max_depth, and include_data_flow parameters.
    const TraceExecutionPathSchema = z.object({ entry_point: z.object({ file: z.string(), line: z.number(), function_name: z.string().optional(), }), max_depth: z.number().default(10), include_data_flow: z.boolean().default(true), });
  • src/index.ts:214-234 (registration)
    Tool registration in the MCP server's listTools response, defining name, description, and inputSchema for trace_execution_path.
    { name: 'trace_execution_path', description: 'Use Gemini to perform deep execution analysis with semantic understanding', inputSchema: { type: 'object', properties: { entry_point: { type: 'object', properties: { file: { type: 'string' }, line: { type: 'number' }, function_name: { type: 'string' }, }, required: ['file', 'line'], }, max_depth: { type: 'number', default: 10 }, include_data_flow: { type: 'boolean', default: true }, }, required: ['entry_point'], }, },

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/haasonsaas/deep-code-reasoning-mcp'

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