Skip to main content
Glama

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
NameRequiredDescriptionDefault
codeYesCode to fix
issue_descriptionYesDescription of the issue

Implementation Reference

  • 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'] }

Other Tools

Related 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/KunihiroS/claude-code-mcp'

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