Skip to main content
Glama

review_code

Analyze code quality and security by submitting code for automated review using Codex and Gemini CLIs to receive structured feedback on best practices and improvements.

Instructions

Request a code review from Codex and Gemini CLIs. Provide code directly as a string. Returns feedback from both reviewers for Claude to consider.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe code to review
contextNoAdditional context about the code (optional)
reviewersNoWhich reviewers to use (default: both)

Implementation Reference

  • The primary handler function for the 'review_code' tool. It extracts arguments, validates required 'code' input, invokes the review logic via performReview, and returns formatted review feedback.
    private async handleReviewCode(args: CodeReviewRequest) { const { code, context, reviewers = ["both"] } = args; if (!code) { throw new Error("Code is required"); } const reviews = await this.performReview(code, context, reviewers); return { content: [ { type: "text", text: this.formatReviews(reviews), }, ], }; }
  • src/index.ts:187-213 (registration)
    The tool registration definition in the getTools() method, which is returned by ListToolsRequestHandler. Includes name, description, and detailed inputSchema.
    { name: "review_code", description: "Request a code review from Codex and Gemini CLIs. Provide code directly as a string. Returns feedback from both reviewers for Claude to consider.", inputSchema: { type: "object", properties: { code: { type: "string", description: "The code to review", }, context: { type: "string", description: "Additional context about the code (optional)", }, reviewers: { type: "array", items: { type: "string", enum: ["codex", "gemini", "both"], }, description: "Which reviewers to use (default: both)", }, }, required: ["code"], }, },
  • TypeScript interface defining the structure of input arguments for review tools, including 'review_code'. Used for type safety in handler functions.
    interface CodeReviewRequest { filePath?: string; directory?: string; code?: string; reviewers?: string[]; context?: string; }
  • The switch case dispatcher in CallToolRequestSchema handler that routes 'review_code' calls to the specific handleReviewCode function.
    case "review_code": return await this.handleReviewCode(args as CodeReviewRequest);

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/je4550/review-mcp'

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