Skip to main content
Glama
evalops

Deep Code Reasoning MCP Server

by evalops

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'],
      },
    },
Behavior2/5

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

With no annotations provided, the description carries full burden but only mentions 'deep execution analysis with semantic understanding' without disclosing behavioral traits like computational cost, rate limits, or output format. It fails to explain what 'analysis' entails operationally, such as whether it modifies data or is read-only, making it inadequate for a tool with complex parameters.

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

Conciseness4/5

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

The description is a single, efficient sentence with no wasted words, making it appropriately sized. However, it lacks front-loading of critical details, as the core purpose is stated but without elaboration, slightly reducing its effectiveness.

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?

Given the tool's complexity (3 parameters, nested objects, no output schema, and 0% schema coverage), the description is incomplete. It doesn't cover parameter meanings, behavioral aspects, or output expectations, failing to provide enough context for the agent to use it effectively beyond a vague notion of analysis.

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

Parameters1/5

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

Schema description coverage is 0%, so the description must compensate but adds no meaning beyond the schema. It doesn't explain parameters like 'entry_point', 'include_data_flow', or 'max_depth', leaving their semantics and usage completely undocumented, which is insufficient for a tool with 3 parameters including nested objects.

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

Purpose3/5

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

The description states the tool 'perform[s] deep execution analysis with semantic understanding' using Gemini, which gives a general purpose but lacks specificity about what 'execution analysis' entails or what resources it analyzes. It doesn't distinguish from siblings like 'performance_bottleneck' or 'escalate_analysis', leaving ambiguity about its unique function.

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 is provided on when to use this tool versus alternatives such as 'performance_bottleneck' or 'escalate_analysis'. The description implies analysis but offers no context, prerequisites, or exclusions, leaving the agent without direction on appropriate use cases.

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

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

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