fix_bug
Fix bugs in code by analyzing problematic code snippets and error descriptions to provide corrected solutions.
Instructions
让 QA 专家修复 Bug
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | 有 Bug 的代码 | |
| error | Yes | 错误信息或 Bug 描述 |
Implementation Reference
- src/server.ts:498-509 (handler)Handler function for the 'fix_bug' tool. Parses input arguments (code and error), defines a specialized bug-fixing expert role, prompts the orchestrator to fix the bug using a 'powerful' tier model, and returns the response.case 'fix_bug': { const { code, error } = args as { code: string; error: string }; const fixRole = '你是一位资深 Bug 修复专家,擅长分析错误信息并提供修复方案。请分析问题根因,给出修复后的完整代码。'; const fix = await orchestrator.askDynamicExpert( 'powerful', fixRole, `请修复以下代码中的 Bug:\n\n代码:\n\`\`\`\n${code}\n\`\`\`\n\n错误信息:${error}` ); return { content: [{ type: 'text', text: fix }], }; }
- src/server.ts:183-200 (registration)Tool registration in the ListToolsRequestSchema handler. Defines the tool name, description, and input schema requiring 'code' and 'error' fields.{ name: 'fix_bug', description: '让 QA 专家修复 Bug', inputSchema: { type: 'object', properties: { code: { type: 'string', description: '有 Bug 的代码', }, error: { type: 'string', description: '错误信息或 Bug 描述', }, }, required: ['code', 'error'], }, },
- src/server.ts:186-199 (schema)Input schema definition for the 'fix_bug' tool, specifying object with required 'code' (buggy code) and 'error' (error description) string properties.inputSchema: { type: 'object', properties: { code: { type: 'string', description: '有 Bug 的代码', }, error: { type: 'string', description: '错误信息或 Bug 描述', }, }, required: ['code', 'error'], },