Skip to main content
Glama
vishalzambre

Honeybadger MCP Server

by vishalzambre

analyze_honeybadger_issue

Analyze Honeybadger errors to identify root causes and receive actionable fix suggestions for application issues.

Instructions

Comprehensive analysis of a Honeybadger issue with fix suggestions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fault_idYesThe ID of the fault to analyze
project_idNoOptional project ID (uses env var if not provided)
include_contextNoInclude request context and parameters in analysis

Implementation Reference

  • Main handler function for 'analyze_honeybadger_issue' tool. Fetches fault details and recent notices from Honeybadger API, then generates analysis using helper.
    private async analyzeIssue(faultId: string, projectId?: string, includeContext: boolean = true): Promise<any> {
      const pid = projectId || this.config.projectId;
      if (!pid) {
        throw new McpError(ErrorCode.InvalidRequest, 'Project ID is required');
      }
    
      // Fetch fault details
      const fault = await this.makeHoneybadgerRequest(`/projects/${pid}/faults/${faultId}`);
    
      // Fetch recent notices
      const notices = await this.makeHoneybadgerRequest(`/projects/${pid}/faults/${faultId}/notices`, {
        limit: 5,
      });
    
      // Create comprehensive analysis
      const analysis = this.generateAnalysis(fault, notices.results || [], includeContext);
    
      return {
        content: [
          {
            type: 'text',
            text: analysis,
          },
        ],
      };
    }
  • Supporting function that generates comprehensive markdown analysis report, including fault overview, error type analysis, stack trace breakdown, context/parameters, and tailored fix suggestions.
      private generateAnalysis(fault: HoneybadgerFault, notices: HoneybadgerNotice[], includeContext: boolean): string {
        const latestNotice = notices[0];
    
        let analysis = `# Honeybadger Issue Analysis
    
    ## Fault Overview
    - **ID**: ${fault.id}
    - **Error Class**: ${fault.klass}
    - **Message**: ${fault.message}
    - **Environment**: ${fault.environment}
    - **Occurrences**: ${fault.notices_count}
    - **First Seen**: ${fault.created_at}
    - **Last Seen**: ${fault.last_notice_at}
    - **Status**: ${fault.resolved ? 'Resolved' : 'Unresolved'}
    - **URL**: ${fault.url}
    
    ## Error Analysis
    
    ### Error Type
    The error "${fault.klass}" suggests:`;
    
        // Add error type analysis
        if (fault.klass.includes('NoMethodError')) {
          analysis += `
    - A method is being called on an object that doesn't respond to it
    - Possible nil object or wrong object type
    - Missing method definition or typo in method name`;
        } else if (fault.klass.includes('NameError')) {
          analysis += `
    - Undefined variable or constant
    - Typo in variable/constant name
    - Scope issues`;
        } else if (fault.klass.includes('ArgumentError')) {
          analysis += `
    - Wrong number of arguments passed to a method
    - Invalid argument values
    - Method signature mismatch`;
        } else if (fault.klass.includes('ActiveRecord')) {
          analysis += `
    - Database-related error
    - Possible migration issues
    - Invalid queries or constraints`;
        } else {
          analysis += `
    - Review the specific error class documentation
    - Check for common patterns in this error type`;
        }
    
        if (latestNotice) {
          analysis += `
    
    ### Stack Trace Analysis
    `;
    
          // Analyze backtrace
          const backtrace = latestNotice.backtrace?.slice(0, 10) || [];
          backtrace.forEach((frame, index) => {
            if (index === 0) {
              analysis += `
    **Primary Error Location:**
    - File: \`${frame.file}\`
    - Method: \`${frame.method}\`
    - Line: ${frame.number}`;
    
              if (frame.source) {
                analysis += `
    - Context:
    \`\`\`
    ${Object.entries(frame.source).map(([line, code]) => `${line}: ${code}`).join('\n')}
    \`\`\``;
              }
            } else if (index < 5) {
              analysis += `
    - ${frame.file}:${frame.number} in \`${frame.method}\``;
            }
          });
    
          if (includeContext && latestNotice.context) {
            analysis += `
    
    ### Request Context
    \`\`\`json
    ${JSON.stringify(latestNotice.context, null, 2)}
    \`\`\``;
          }
    
          if (includeContext && latestNotice.params && Object.keys(latestNotice.params).length > 0) {
            analysis += `
    
    ### Request Parameters
    \`\`\`json
    ${JSON.stringify(latestNotice.params, null, 2)}
    \`\`\``;
          }
        }
    
        analysis += `
    
    ## Recommended Fix Strategies
    
    ### Immediate Actions
    1. **Reproduce the Error**
       - Use the provided context and parameters
       - Set up similar conditions in development
       - Add logging around the error location
    
    2. **Quick Fixes**`;
    
        // Add specific fix suggestions based on error type
        if (fault.klass.includes('NoMethodError')) {
          analysis += `
       - Add nil checks: \`object&.method_name\`
       - Verify object type before method calls
       - Check method spelling and availability`;
        } else if (fault.klass.includes('ArgumentError')) {
          analysis += `
       - Review method signatures
       - Validate input parameters
       - Add parameter validation`;
        } else if (fault.klass.includes('ActiveRecord')) {
          analysis += `
       - Check database migrations
       - Validate model associations
       - Review query syntax`;
        }
    
        analysis += `
    
    ### Long-term Solutions
    1. **Add Error Handling**
       - Implement proper exception handling
       - Add user-friendly error messages
       - Log detailed error information
    
    2. **Add Tests**
       - Write unit tests covering the error scenario
       - Add integration tests for the affected flow
       - Include edge case testing
    
    3. **Code Review**
       - Review similar patterns in codebase
       - Look for related potential issues
       - Implement defensive programming practices
    
    ### Monitoring
    - Set up alerts for this error pattern
    - Monitor error frequency after fixes
    - Track related errors that might emerge
    
    ## Next Steps
    1. Examine the code at the primary error location
    2. Set up local reproduction using the provided context
    3. Implement the recommended fixes
    4. Add appropriate tests
    5. Deploy and monitor the fix effectiveness
    
    ---
    *Analysis generated from Honeybadger fault #${fault.id}*`;
    
        return analysis;
      }
  • src/index.ts:162-184 (registration)
    Tool registration entry in the ListTools handler, defining name, description, and input schema for 'analyze_honeybadger_issue'.
    {
      name: 'analyze_honeybadger_issue',
      description: 'Comprehensive analysis of a Honeybadger issue with fix suggestions',
      inputSchema: {
        type: 'object',
        properties: {
          fault_id: {
            type: 'string',
            description: 'The ID of the fault to analyze',
          },
          project_id: {
            type: 'string',
            description: 'Optional project ID (uses env var if not provided)',
          },
          include_context: {
            type: 'boolean',
            description: 'Include request context and parameters in analysis',
            default: true,
          },
        },
        required: ['fault_id'],
      },
    },
  • Input schema definition for the tool, specifying parameters like fault_id (required), project_id, and include_context.
    inputSchema: {
      type: 'object',
      properties: {
        fault_id: {
          type: 'string',
          description: 'The ID of the fault to analyze',
        },
        project_id: {
          type: 'string',
          description: 'Optional project ID (uses env var if not provided)',
        },
        include_context: {
          type: 'boolean',
          description: 'Include request context and parameters in analysis',
          default: true,
        },
      },
      required: ['fault_id'],
Behavior2/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 of behavioral disclosure. While 'analysis' and 'fix suggestions' imply a read-only operation, it doesn't specify whether this requires authentication, has rate limits, or what the output format looks like. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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, efficient sentence that clearly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded with the core functionality.

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

Completeness3/5

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

Given the tool's moderate complexity (analysis with suggestions), no annotations, and no output schema, the description is minimally adequate. It states what the tool does but lacks details on output format, error handling, or integration with siblings. It meets basic requirements but has clear gaps for effective agent use.

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 100%, so the schema already documents all three parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't explain what 'comprehensive analysis' entails or how parameters affect it). Baseline 3 is appropriate when the schema does the heavy lifting.

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 performs 'comprehensive analysis' of a Honeybadger issue and provides 'fix suggestions', which is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'get_honeybadger_fault' or 'get_honeybadger_notices', which might provide similar data without analysis or suggestions.

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. There's no mention of when to choose this analysis tool over the sibling 'get' tools, nor any prerequisites or exclusions. The agent must infer usage from the description alone.

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/vishalzambre/honeybadger-mcp'

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