Skip to main content
Glama

review_file

Get comprehensive code review feedback from Codex and Gemini CLIs to improve code quality, security, and performance. Submit any file for analysis and receive actionable suggestions from multiple AI reviewers.

Instructions

Request a code review of a specific file from Codex and Gemini CLIs. Returns feedback from both reviewers for Claude to consider.

Input Schema

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

Implementation Reference

  • The handleReviewFile method implements the core logic for the 'review_file' tool. It extracts arguments, validates filePath, reads the file content, performs the review using performReview helper, formats the output, and returns it as MCP content.
    private async handleReviewFile(args: CodeReviewRequest) { const { filePath, context, reviewers = ["both"] } = args; if (!filePath) { throw new Error("File path is required"); } const code = await fs.readFile(filePath, "utf-8"); const reviews = await this.performReview( code, `File: ${filePath}\n${context || ""}`, reviewers ); return { content: [ { type: "text", text: this.formatReviews(reviews), }, ], }; }
  • TypeScript interface defining the expected shape of arguments for the review_file tool and related tools.
    interface CodeReviewRequest { filePath?: string; directory?: string; code?: string; reviewers?: string[]; context?: string; }
  • The JSON schema for input validation of the 'review_file' tool parameters in the tool registration.
    inputSchema: { type: "object", properties: { filePath: { type: "string", description: "Path to the file 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: ["filePath"], },
  • src/index.ts:214-240 (registration)
    The tool registration object in getTools() method, which provides name, description, and inputSchema for ListToolsRequestSchema.
    { name: "review_file", description: "Request a code review of a specific file from Codex and Gemini CLIs. Returns feedback from both reviewers for Claude to consider.", inputSchema: { type: "object", properties: { filePath: { type: "string", description: "Path to the file 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: ["filePath"], }, },
  • src/index.ts:109-110 (registration)
    The switch case in CallToolRequestSchema handler that routes 'review_file' calls to the handleReviewFile method.
    case "review_file": return await this.handleReviewFile(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