Skip to main content
Glama

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
NameRequiredDescriptionDefault
ownerYesRepository owner (username or organization)
pull_numberYesPull request number
repoYesRepository name

Implementation Reference

  • 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);
    }
  • 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)
    },
  • 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) }],
      };
    }

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/tuanle96/mcp-github'

If you have feedback or need assistance with the MCP directory API, please join our Discord server