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
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | Additional context about the code (optional) | |
| filePath | Yes | Path to the file to review | |
| reviewers | No | Which reviewers to use (default: both) |
Implementation Reference
- src/index.ts:290-312 (handler)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), }, ], }; }
- src/index.ts:17-23 (schema)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; }
- src/index.ts:218-239 (schema)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);