Skip to main content
Glama

review_code

Analyzes and evaluates provided code to identify potential issues, improve quality, and ensure alignment with specified focus areas.

Instructions

Reviews the given code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesCode to review
focus_areasNoAreas to focus on

Implementation Reference

  • Handler for the 'review_code' tool. Extracts arguments, encodes the code to base64, constructs a prompt for code review, calls Claude CLI via runClaudeCommand, and returns the response.
    case 'review_code': { const { code, focus_areas } = args; try { logger.debug(`Processing review_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 review the following Base64 encoded code. Consider code readability, efficiency, potential bugs, and security vulnerabilities.\n\nCode:\n${encodedCode}\n\nFocus areas (if provided):\n${focus_areas || 'No specific focus areas provided.'}`; 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 }] }; } catch (err) { logger.error("Error in review_code:", err); logger.debug(`review_code error details: ${err instanceof Error ? err.stack : String(err)}`); throw err; } }
  • Registration of the 'review_code' tool in the ListTools response, including name, description, and input schema.
    { name: 'review_code', description: 'Reviews the given code.', inputSchema: { type: 'object', properties: { code: { type: 'string', description: 'Code to review' }, focus_areas: { type: 'string', description: 'Areas to focus on', default: '' } }, required: ['code'] } },
  • Input schema definition for the 'review_code' tool, specifying required 'code' parameter and optional 'focus_areas'.
    inputSchema: { type: 'object', properties: { code: { type: 'string', description: 'Code to review' }, focus_areas: { type: 'string', description: 'Areas to focus on', default: '' } }, required: ['code'] } },

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