Skip to main content
Glama
KunihiroS

claude-code-mcp

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']
      }
    },
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure but offers none. 'Reviews the given code' doesn't reveal whether this is a read-only analysis, whether it modifies code, what permissions might be needed, what format the review takes, or any limitations. For a tool that presumably analyzes code, this lack of behavioral context is completely inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

While technically concise with just 4 words, this is under-specification rather than effective conciseness. The single sentence 'Reviews the given code' fails to provide necessary information that would help an agent use the tool correctly. Every word should earn its place, but here the minimal text creates ambiguity rather than clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of code review (which could involve security, performance, style, correctness, etc.) and the presence of multiple sibling tools with overlapping functions, this description is completely inadequate. With no annotations, no output schema, and multiple similar tools available, the description fails to provide the contextual information needed to select and use this tool appropriately.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('code' and 'focus_areas') adequately. The description adds no parameter information beyond what the schema provides - it doesn't explain what constitutes valid 'focus_areas' or how they affect the review. Baseline 3 is appropriate when the schema does the heavy lifting, though the description adds zero value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Reviews the given code' is a tautology that restates the tool name 'review_code' without adding meaningful specificity. It doesn't distinguish this tool from siblings like 'explain_code' or 'fix_code' - both could involve reviewing code. The description lacks a clear verb+resource combination that defines what 'reviewing' entails versus other code analysis operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides absolutely no guidance about when to use this tool versus alternatives. With siblings like 'explain_code', 'fix_code', and 'test_code' available, there's no indication whether this tool is for code quality assessment, security review, performance analysis, or general explanation. The agent receives no help in selecting between these closely related code analysis tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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