Skip to main content
Glama
piyushgIITian

GitHub Enterprise MCP Server

get-pull-request-reviews

Retrieve all reviews for a specific GitHub pull request to track feedback, approvals, and changes requested during code review.

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 handler function that executes the tool logic: parses input using Zod schema, calls GitHub API to list reviews for the specified pull request, maps the response, and handles errors.
    export async function getPullRequestReviews(args: unknown): Promise<any> {
      const { owner, repo, pull_number } = GetPullRequestReviewsSchema.parse(args);
      const github = getGitHubApi();
    
      return tryCatchAsync(async () => {
        const { data } = await github.getOctokit().pulls.listReviews({
          owner,
          repo,
          pull_number,
        });
    
        return data.map((review) => ({
          id: review.id,
          user: review.user ? {
            login: review.user.login,
            id: review.user.id,
          } : null,
          body: review.body,
          state: review.state,
          commit_id: review.commit_id,
          submitted_at: review.submitted_at,
          url: review.html_url,
        }));
      }, 'Failed to get pull request reviews');
    }
  • MCP tool schema definition including input schema for the 'get-pull-request-reviews' tool, registered in the listTools response.
    {
      name: 'get-pull-request-reviews',
      description: 'Get the reviews on a pull request',
      inputSchema: {
        type: 'object',
        properties: {
          owner: {
            type: 'string',
            description: 'Repository owner (username or organization)',
          },
          repo: {
            type: 'string',
            description: 'Repository name',
          },
          pull_number: {
            type: 'number',
            description: 'Pull request number',
          },
        },
        required: ['owner', 'repo', 'pull_number'],
        additionalProperties: false,
      },
    },
  • Registration of the tool handler in the switch statement for CallToolRequest.
    case 'get-pull-request-reviews':
      result = await getPullRequestReviews(parsedArgs);
      break;
  • Zod schema for input validation used within the handler function.
    export const GetPullRequestReviewsSchema = OwnerRepoSchema.extend({
      pull_number: z.number().int().positive(),
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It implies a read-only operation ('Get'), but doesn't detail authentication needs, rate limits, pagination, error conditions, or the structure of returned reviews. For a tool with zero annotation coverage, this is a significant gap in transparency about how it behaves in practice.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with zero wasted words. It front-loads the core purpose ('Get the reviews') and efficiently specifies the target ('on a pull request'). Every word earns its place, making it highly concise and well-structured for quick comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a pull request review tool with no annotations and no output schema, the description is incomplete. It doesn't explain what a 'review' entails, the return format, or behavioral aspects like permissions or limitations. While the schema covers inputs, the overall context for effective tool use is lacking, especially for a read operation that likely returns structured data.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are fully documented in the schema itself. The description adds no additional meaning beyond implying that these parameters identify a specific pull request to fetch reviews from. This meets the baseline score of 3, as the schema handles the heavy lifting without needing compensation from the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('reviews on a pull request'), making the tool's purpose immediately understandable. It distinguishes itself from siblings like 'get-pull-request-comments' by specifying reviews rather than comments. However, it doesn't explicitly mention what constitutes a 'review' (e.g., approval, changes requested) or differentiate from 'create-pull-request-review', which slightly limits specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing pull request), compare to related tools like 'get-pull-request' or 'get-pull-request-comments', or specify scenarios where reviews are relevant (e.g., code review workflows). This leaves the agent to infer usage from context alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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