Skip to main content
Glama

Debug Issue

debug-issue

Debug technical issues using systematic problem-solving with AI assistance. Input tasks, symptoms, and files to identify and resolve errors.

Instructions

Debug technical issues with systematic problem-solving approach

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYesWhat to debug (e.g., 'fix login error', 'investigate memory leak')
filesNoRelevant file paths (optional)
symptomsNoError symptoms or behavior observed
providerNoAI provider to usegemini

Implementation Reference

  • Implementation of the debug-issue tool handler in AIToolHandlers class. Uses ProviderManager to select AI provider, constructs systematic debugging prompt, calls generateText, and returns structured response with metadata.
    async handleDebugIssue(params: z.infer<typeof DebugIssueSchema>) {
      // Use provided provider or get the preferred one (Azure if configured)
      const providerName = params.provider || (await this.providerManager.getPreferredProvider(['openai', 'gemini', 'azure']));
      const provider = await this.providerManager.getProvider(providerName);
      
      const systemPrompt = `You are an expert debugger and problem solver. Help identify and solve technical issues.
      
      Approach debugging systematically:
      - Analyze the problem description and symptoms
      - Identify potential root causes
      - Suggest specific debugging steps
      - Provide solution recommendations
      - Consider edge cases and related issues
      
      Be methodical and provide actionable debugging guidance.`;
    
      let prompt = `Debug the following issue: ${params.task}`;
      if (params.symptoms) {
        prompt += `\n\nSymptoms observed: ${params.symptoms}`;
      }
      if (params.files) {
        prompt += `\n\nRelevant files: ${params.files.join(", ")}`;
      }
    
      const response = await provider.generateText({
        prompt,
        systemPrompt,
        temperature: 0.4, // Balanced temperature for debugging creativity
        reasoningEffort: (providerName === "openai" || providerName === "azure" || providerName === "grok") ? "high" : undefined,
        useSearchGrounding: false, // No search needed for debugging
      });
    
      return {
        content: [
          {
            type: "text",
            text: response.text,
          },
        ],
        metadata: {
          provider: providerName,
          model: response.model,
          symptoms: params.symptoms,
          usage: response.usage,
          ...response.metadata,
        },
      };
    }
  • Zod schema definition for debug-issue tool input validation, defining task, optional files, symptoms, and provider.
    const DebugIssueSchema = z.object({
      task: z.string().describe("What to debug (e.g., 'fix login error', 'investigate memory leak')"),
      files: z.array(z.string()).optional().describe("Relevant file paths (optional)"),
      symptoms: z.string().optional().describe("Error symptoms or behavior observed"),
      provider: z.enum(["openai", "gemini", "azure", "grok"]).optional().default("gemini").describe("AI provider to use"),
    });
  • src/server.ts:304-312 (registration)
    Registration of the debug-issue tool on the MCP server, specifying title, description, input schema, and handler invocation via getHandlers().
    // Register debug-issue tool
    server.registerTool("debug-issue", {
      title: "Debug Issue",
      description: "Debug technical issues with systematic problem-solving approach",
      inputSchema: DebugIssueSchema.shape,
    }, async (args) => {
      const aiHandlers = await getHandlers();
      return await aiHandlers.handleDebugIssue(args);
    });
  • src/server.ts:624-641 (registration)
    MCP prompt registration for debug-issue, providing a string-based argsSchema and message construction for prompt-based invocation.
    server.registerPrompt("debug-issue", {
      title: "Debug Issue",
      description: "Debug technical issues with systematic problem-solving approach",
      argsSchema: {
        task: z.string().optional(),
        files: z.string().optional(),
        symptoms: z.string().optional(),
        provider: z.string().optional(),
      },
    }, (args) => ({
      messages: [{
        role: "user",
        content: {
          type: "text",
          text: `Debug this issue: ${args.task || 'Please specify what issue to debug (e.g., error message, unexpected behavior).'}${args.files ? `\n\nRelevant files: ${args.files}` : ''}${args.symptoms ? `\n\nSymptoms observed: ${args.symptoms}` : ''}${args.provider ? ` (using ${args.provider} provider)` : ''}`
        }
      }]
    }));
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions a 'systematic problem-solving approach' but doesn't explain what this entails operationally—such as whether it performs analysis, generates solutions, requires specific permissions, has rate limits, or what the output format might be. This leaves significant gaps for a tool with 4 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 that front-loads the core purpose. However, it could be more structured by explicitly mentioning key parameters or differentiating from siblings, but it avoids unnecessary verbosity.

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 implied by 4 parameters, no annotations, and no output schema, the description is incomplete. It doesn't clarify what the tool actually does (e.g., analysis, solution generation), how it interacts with the AI provider parameter, or what results to expect, leaving too much ambiguity for effective 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 fully documents all 4 parameters (task, files, symptoms, provider). The description adds no additional meaning beyond what's in the schema, such as explaining relationships between parameters or usage examples. 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.

Purpose3/5

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

The description 'Debug technical issues with systematic problem-solving approach' states a general purpose but lacks specificity about what resources it operates on or how it differs from similar tools like 'investigate', 'ultra-debug', or 'tracer'. It mentions 'technical issues' but doesn't specify whether this is for code, systems, or other domains, making it somewhat vague.

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 like 'investigate', 'ultra-debug', or 'tracer' from the sibling list. The description implies a debugging context but offers no explicit when/when-not criteria or prerequisites for usage.

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/RealMikeChong/ultra-mcp'

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