Skip to main content
Glama

debug_problem

Systematically debug software issues by generating hypotheses, test strategies, and resolution steps for described problems.

Instructions

Provides a systematic debugging approach for a described problem. Generates hypotheses, test strategies, and resolution steps.

Input Schema

NameRequiredDescriptionDefault
problemYesDescription of the problem/bug
symptomsNoObserved symptoms
contextNoEnvironment, recent changes, etc.

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "context": { "description": "Environment, recent changes, etc.", "type": "string" }, "problem": { "description": "Description of the problem/bug", "type": "string" }, "symptoms": { "description": "Observed symptoms", "items": { "type": "string" }, "type": "array" } }, "required": [ "problem" ], "type": "object" }

Implementation Reference

  • The handler function that executes the 'debug_problem' tool. It takes input args (problem, symptoms, context) and generates a comprehensive markdown debugging guide with phases, hypotheses, and tools.
    export function debugProblemHandler(args: any) { const { problem, symptoms = [], context = "" } = args; const debug = `# Debug Analysis: ${problem} ## Problem Statement ${problem} ## Observed Symptoms ${symptoms.length > 0 ? symptoms.map((s: string) => `- ${s}`).join("\n") : "No specific symptoms listed"} ## Context ${context || "No additional context provided"} --- ## Debugging Strategy ### Phase 1: Reproduce - [ ] Can you consistently reproduce the issue? - [ ] What are the exact steps to reproduce? - [ ] Does it happen in all environments? ### Phase 2: Isolate - [ ] What is the smallest code that shows the bug? - [ ] When did this start happening? - [ ] What changed recently? ### Phase 3: Hypotheses Based on the symptoms, possible causes: 1. **Data Issue**: Invalid input or state 2. **Logic Error**: Incorrect condition or algorithm 3. **Timing Issue**: Race condition or async problem 4. **Environment**: Configuration or dependency issue 5. **Integration**: External service or API problem ### Phase 4: Test Each Hypothesis For each hypothesis above: - Add logging/breakpoints - Check relevant data - Verify assumptions ### Phase 5: Fix & Verify - [ ] Implement minimal fix - [ ] Verify fix resolves issue - [ ] Check for regressions - [ ] Add test to prevent recurrence ## Tools to Use - Debugger (breakpoints, step-through) - Logging (add strategic log points) - Network inspector (API issues) - Profiler (performance issues) `; return { content: [{ type: "text", text: debug }] }; }
  • Zod schema definition for the 'debug_problem' tool inputs: required 'problem' string, optional 'symptoms' array and 'context' string.
    export const debugProblemSchema = { name: "debug_problem", description: "Provides a systematic debugging approach for a described problem. Generates hypotheses, test strategies, and resolution steps.", inputSchema: z.object({ problem: z.string().describe("Description of the problem/bug"), symptoms: z.array(z.string()).optional().describe("Observed symptoms"), context: z.string().optional().describe("Environment, recent changes, etc.") }) };
  • src/server.ts:92-92 (registration)
    Registration of 'debug_problem' tool in the HTTP server's toolRegistry Map.
    ["debug_problem", { schema: debugProblemSchema, handler: debugProblemHandler }],
  • src/index.ts:82-82 (registration)
    Registration of 'debug_problem' tool in the stdio server's toolRegistry Map.
    ["debug_problem", { schema: debugProblemSchema, handler: debugProblemHandler }],

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/millsydotdev/Code-MCP'

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