fix_code
Identify and resolve bugs or issues in your code using detailed issue descriptions for precise fixes and improved functionality.
Instructions
Fixes bugs or issues in the given code.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Code to fix | |
| issue_description | Yes | Description of the issue |
Implementation Reference
- claude-code-server/src/index.ts:549-559 (handler)The execution handler for the 'fix_code' tool. It encodes the input code to base64, constructs a prompt with the issue description, invokes the Claude CLI using runClaudeCommand, and returns the fixed code output.case 'fix_code': { const { code, issue_description } = args; logger.debug(`Processing fix_code request, code length: ${code.length}`); const encodedCode = encodeText(truncateIfNeeded(code)); logger.debug(`Code encoded to base64, length: ${encodedCode.length}`); const prompt = `You are super professional engineer. Please fix the following Base64 encoded code, addressing the issue described below:\n\nCode:\n${encodedCode}\n\nIssue description:\n${issue_description ?? 'No specific issue described.'}`; logger.debug('Calling Claude CLI with prompt'); const output = await runClaudeCommand(['--print'], prompt); logger.debug(`Received response from Claude, length: ${output.length}`); return { content: [{ type: 'text', text: output }] }; }
- Tool definition in ListTools response, including name, description, and input schema for 'fix_code' which requires 'code' and 'issue_description'.{ name: 'fix_code', description: 'Fixes bugs or issues in the given code.', inputSchema: { type: 'object', properties: { code: { type: 'string', description: 'Code to fix' }, issue_description: { type: 'string', description: 'Description of the issue' } }, required: ['code', 'issue_description'] }