Skip to main content
Glama
emmron
by emmron

mcp__gemini__debug_master

Debug and analyze code errors with step-by-step insights, execution simulation, and fix validation. Supports multiple languages for efficient troubleshooting in development workflows.

Instructions

Advanced debugging with execution simulation, fix validation, and step-by-step analysis

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoCode where error occurs
contextNoAdditional context
error_messageYesError message or description
languageNoProgramming languagejavascript
simulate_executionNoEnable execution simulation
stack_traceNoStack trace if available

Implementation Reference

  • The main execution handler for the 'mcp__gemini__debug_master' tool. It processes error messages, code, stack traces, and context to provide root cause analysis, optional execution simulation, fix suggestions, and validation guidance using AI calls.
        handler: async (args) => {
          const { error_message, code, stack_trace, context = '', language = 'javascript', simulate_execution = true } = args;
          validateString(error_message, 'error_message');
          
          const timer = performanceMonitor.startTimer('debug_master');
          
          let debugPrompt = `Advanced debugging analysis for ${language} error:
    
    **Error**: ${error_message}
    
    ${stack_trace ? `**Stack Trace**:\n\`\`\`\n${stack_trace}\n\`\`\`\n` : ''}
    
    ${code ? `**Code Context**:\n\`\`\`${language}\n${code}\n\`\`\`\n` : ''}
    
    ${context ? `**Additional Context**: ${context}\n` : ''}
    
    Provide comprehensive debugging analysis:
    
    1. **Root Cause Analysis**
       - Primary cause identification
       - Contributing factors
       - Error propagation path
    
    2. **Code Flow Analysis**
       - Execution path leading to error
       - Variable states at error point
       - Control flow issues
    
    3. **Debugging Strategy**
       - Step-by-step debugging approach
       - Key checkpoints to examine
       - Data points to verify
    
    4. **Fix Solutions**
       - Primary fix with code example
       - Alternative approaches
       - Prevention strategies
    
    5. **Testing Validation**
       - How to verify the fix
       - Edge cases to test
       - Regression testing points
    
    Be specific and actionable.`;
    
          const analysis = await aiClient.call(debugPrompt, 'debug', { maxTokens: 3000 });
          
          let result = `🐛 **Debug Master Analysis** (${language})
    
    ${analysis}`;
    
          // Execution simulation if enabled and code is provided
          if (simulate_execution && code) {
            const simulationPrompt = `Simulate the execution of this code step by step:
    
    \`\`\`${language}
    ${code}
    \`\`\`
    
    Error: ${error_message}
    
    Provide:
    1. **Step-by-step execution trace**
       - Line-by-line execution flow
       - Variable values at each step
       - Function calls and returns
    
    2. **Error Point Analysis**
       - Exact line where error occurs
       - Variable states at error
       - Memory/scope situation
    
    3. **Execution Scenarios**
       - Normal execution path
       - Error-triggering scenario
       - Edge case behaviors
    
    4. **State Verification**
       - Expected vs actual values
       - Assumption violations
       - Boundary condition issues
    
    Format as a detailed execution trace.`;
    
            const simulation = await aiClient.call(simulationPrompt, 'analysis');
            
            result += `
    
    ---
    
    🔄 **Execution Simulation**
    
    ${simulation}`;
          }
          
          // Generate fix validation
          if (code) {
            const validationPrompt = `Based on the debugging analysis, validate potential fixes:
    
    Original Code:
    \`\`\`${language}
    ${code}
    \`\`\`
    
    Error: ${error_message}
    
    Provide:
    1. **Fix Validation Checklist**
       - Critical points to verify
       - Test cases to validate
       - Edge conditions to check
    
    2. **Regression Risk Assessment**
       - Areas that might be affected
       - Side effects to monitor
       - Backward compatibility concerns
    
    3. **Monitoring Recommendations**
       - What to watch after deployment
       - Logging improvements
       - Alert configurations`;
    
            const validation = await aiClient.call(validationPrompt, 'review');
            
            result += `
    
    ---
    
    ✅ **Fix Validation Guide**
    
    ${validation}`;
          }
          
          timer.end();
          return result;
        }
  • The input parameters schema defining the expected arguments for the tool, including required error_message and optional fields like code, stack_trace, etc.
    parameters: {
      error_message: { type: 'string', description: 'Error message or description', required: true },
      code: { type: 'string', description: 'Code where error occurs' },
      stack_trace: { type: 'string', description: 'Stack trace if available' },
      context: { type: 'string', description: 'Additional context' },
      language: { type: 'string', description: 'Programming language', default: 'javascript' },
      simulate_execution: { type: 'boolean', description: 'Enable execution simulation', default: true }
    },
  • The registration code that imports and registers all tools from the enhancedTools module, which includes 'mcp__gemini__debug_master', by calling registerToolsFromModule(enhancedTools).
    this.registerToolsFromModule(codeTools);
    this.registerToolsFromModule(analysisTools);
    this.registerToolsFromModule(enhancedTools);
    this.registerToolsFromModule(businessTools);
    this.registerToolsFromModule(licenseTools);
  • Import statement that brings in the enhancedTools object containing the definition of 'mcp__gemini__debug_master'.
    import { enhancedTools } from './enhanced-tools.js';
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'execution simulation, fix validation, and step-by-step analysis' but fails to detail critical aspects like whether this is a read-only or mutating operation, permission requirements, rate limits, or what the output entails. For a debugging tool with potential side effects, this is a significant gap in transparency.

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 that front-loads key features without unnecessary elaboration. It avoids redundancy and waste, making it appropriately concise for a tool with a clear name and schema support.

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 complexity of a debugging tool with 6 parameters, no annotations, and no output schema, the description is incomplete. It lacks details on behavioral traits, output format, error handling, and differentiation from siblings. While the schema covers parameters, the description fails to provide sufficient context for safe and effective use in a multi-tool environment.

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?

The schema description coverage is 100%, meaning all parameters are documented in the input schema. The description adds no additional meaning beyond the schema, such as explaining parameter interactions or usage examples. Given the high coverage, a baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract from the schema's documentation.

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 tool's purpose as 'Advanced debugging with execution simulation, fix validation, and step-by-step analysis,' which specifies the verb (debugging) and key features. However, it doesn't explicitly distinguish this tool from its sibling 'mcp__gemini__debug_analysis,' which appears to be a similar debugging tool, leaving some ambiguity about their differentiation.

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?

The description provides no guidance on when to use this tool versus alternatives, such as the sibling 'mcp__gemini__debug_analysis' or other debugging-related tools. It lacks explicit context, prerequisites, or exclusions, offering only a high-level feature list without practical usage scenarios.

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/emmron/gemini-mcp'

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