Skip to main content
Glama

review_file

Analyze code files with Codex and Gemini reviewers to get feedback on quality, security, and best practices for Claude's consideration.

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
filePathYesPath to the file to review
contextNoAdditional context about the code (optional)
reviewersNoWhich reviewers to use (default: both)

Implementation Reference

  • The primary handler function for the 'review_file' tool. Reads the file content using fs.readFile, invokes performReview with context, and returns formatted review feedback.
    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 input parameters for review tools, including filePath required for review_file.
    interface CodeReviewRequest { filePath?: string; directory?: string; code?: string; reviewers?: string[]; context?: string; }
  • JSON schema in the tool definition specifying input validation for review_file: requires filePath, optional context and reviewers.
    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)
    Registration of the 'review_file' tool in the getTools() method, which is returned by the ListTools handler.
    { 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"], }, },
  • Dispatcher case in the CallToolRequestSchema handler that routes 'review_file' calls to the specific 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