submit_pull_request_review
Submit a pull request review to approve, request changes, or add comments using specified repository details and review ID for GitHub repositories.
Instructions
Submit a pull request review (approve, request changes, or comment)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | The body text of the review submission | |
| event | Yes | The review action to perform | |
| owner | Yes | Repository owner (username or organization) | |
| pull_number | Yes | Pull request number | |
| repo | Yes | Repository name | |
| review_id | Yes | The ID of the review |
Implementation Reference
- src/operations/pulls.ts:275-296 (handler)The core handler function that executes the tool logic by making a POST request to the GitHub API to submit a pull request review.export async function submitPullRequestReview( github_pat: string, owner: string, repo: string, pullNumber: number, reviewId: number, event: 'APPROVE' | 'REQUEST_CHANGES' | 'COMMENT', body?: string ): Promise<z.infer<typeof PullRequestReviewSchema>> { const response = await githubRequest( github_pat, `https://api.github.com/repos/${owner}/${repo}/pulls/${pullNumber}/reviews/${reviewId}/events`, { method: 'POST', body: { event, body, }, } ); return PullRequestReviewSchema.parse(response); }
- src/operations/pulls.ts:130-141 (schema)Input schema definition for the submit_pull_request_review tool, including public schema and internal extended schema with GitHub PAT.export const SubmitPullRequestReviewSchema = z.object({ owner: z.string().describe("Repository owner (username or organization)"), repo: z.string().describe("Repository name"), pull_number: z.number().describe("Pull request number"), review_id: z.number().describe("The ID of the review"), event: z.enum(['APPROVE', 'REQUEST_CHANGES', 'COMMENT']).describe("The review action to perform"), body: z.string().optional().describe("The body text of the review submission") }); export const _SubmitPullRequestReviewSchema = SubmitPullRequestReviewSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });
- src/index.ts:201-204 (registration)Tool registration in the MCP server's list of tools, specifying name, description, and input schema.name: "submit_pull_request_review", description: "Submit a pull request review (approve, request changes, or comment)", inputSchema: zodToJsonSchema(pulls.SubmitPullRequestReviewSchema), },
- src/index.ts:597-606 (handler)MCP server request handler that parses arguments and delegates to the submitPullRequestReview function.case "submit_pull_request_review": { const args = pulls._SubmitPullRequestReviewSchema.parse(params.arguments); const { github_pat, owner, repo, pull_number, review_id, event, body } = args; const result = await pulls.submitPullRequestReview( github_pat, owner, repo, pull_number, review_id, event, body ); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }