get_pull_request_reviews
Retrieve reviews for a GitHub pull request by specifying the repository owner, repository name, and pull request number to track feedback and code review status.
Instructions
Get the reviews on a pull request
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner (username or organization) | |
| pull_number | Yes | Pull request number | |
| repo | Yes | Repository name |
Implementation Reference
- operations/pulls.ts:277-286 (handler)The main handler function that executes the tool logic by calling the GitHub API to fetch reviews for a specific pull request and parsing the response.export async function getPullRequestReviews( owner: string, repo: string, pullNumber: number ): Promise<z.infer<typeof PullRequestReviewSchema>[]> { const response = await githubRequest( `https://api.github.com/repos/${owner}/${repo}/pulls/${pullNumber}/reviews` ); return z.array(PullRequestReviewSchema).parse(response); }
- operations/pulls.ts:156-160 (schema)Input schema validation using Zod for the get_pull_request_reviews tool parameters.export const GetPullRequestReviewsSchema = 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") });
- index.ts:195-199 (registration)Tool registration in the list of available tools, including name, description, and input schema reference.{ name: "get_pull_request_reviews", description: "Get the reviews on a pull request", inputSchema: zodToJsonSchema(pulls.GetPullRequestReviewsSchema) },
- index.ts:566-576 (handler)Dispatch handler in the main switch statement that parses arguments, calls the pulls.getPullRequestReviews function, and formats the response.case "get_pull_request_reviews": { const args = pulls.GetPullRequestReviewsSchema.parse(request.params.arguments); const reviews = await pulls.getPullRequestReviews( args.owner, args.repo, args.pull_number ); return { content: [{ type: "text", text: JSON.stringify(reviews, null, 2) }], }; }