Skip to main content
Glama

create_pull_request_review

Submit a review on a GitHub pull request by specifying the repository owner, repository name, pull request number, review text, and action (approve, request changes, or comment). Includes optional file-specific comments.

Instructions

Create a review on a pull request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesThe body text of the review
commentsNoComments to post as part of the review
commit_idNoThe SHA of the commit that needs a review
eventYesThe review action to perform
ownerYesRepository owner (username or organization)
pull_numberYesPull request number
repoYesRepository name

Implementation Reference

  • The handler logic in the main switch statement that parses arguments, calls the createPullRequestReview function, and returns the result.
    case "create_pull_request_review": {
      const args = pulls.CreatePullRequestReviewSchema.parse(request.params.arguments);
      const { owner, repo, pull_number, ...options } = args;
      const review = await pulls.createPullRequestReview(owner, repo, pull_number, options);
      return {
        content: [{ type: "text", text: JSON.stringify(review, null, 2) }],
      };
    }
  • Zod schema defining the input parameters for the create_pull_request_review tool.
    export const CreatePullRequestReviewSchema = 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"),
      commit_id: z.string().optional().describe("The SHA of the commit that needs a review"),
      body: z.string().describe("The body text of the review"),
      event: z.enum(['APPROVE', 'REQUEST_CHANGES', 'COMMENT']).describe("The review action to perform"),
      comments: z.array(z.object({
        path: z.string().describe("The relative path to the file being commented on"),
        position: z.number().describe("The position in the diff where you want to add a review comment"),
        body: z.string().describe("Text of the review comment")
      })).optional().describe("Comments to post as part of the review")
    });
  • index.ts:166-169 (registration)
    Tool registration in the list of available tools, including name, description, and input schema reference.
      name: "create_pull_request_review",
      description: "Create a review on a pull request",
      inputSchema: zodToJsonSchema(pulls.CreatePullRequestReviewSchema)
    },
  • The core helper function that makes the GitHub API request to create the pull request review.
    export async function createPullRequestReview(
      owner: string,
      repo: string,
      pullNumber: number,
      options: Omit<z.infer<typeof CreatePullRequestReviewSchema>, 'owner' | 'repo' | 'pull_number'>
    ): Promise<z.infer<typeof PullRequestReviewSchema>> {
      const response = await githubRequest(
        `https://api.github.com/repos/${owner}/${repo}/pulls/${pullNumber}/reviews`,
        {
          method: 'POST',
          body: options,
        }
      );
      return PullRequestReviewSchema.parse(response);
    }
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. 'Create a review' implies a write/mutation operation, but it doesn't specify permissions required (e.g., collaborator status), whether reviews are editable/deletable, rate limits, or what happens on success/failure. It lacks context about the review's impact (e.g., blocking merges) or return format, leaving significant gaps for a mutation tool.

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, efficient sentence with zero wasted words. It's front-loaded with the core action and resource, making it immediately understandable. Every word earns its place without redundancy or unnecessary elaboration.

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?

For a mutation tool with 7 parameters, no annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like permissions, side effects, or error handling, nor does it explain the purpose of key parameters like 'event' or 'comments'. Given the complexity and lack of structured data, it should provide more context to guide effective use.

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 the schema fully documents all 7 parameters (owner, repo, pull_number, body, event, commit_id, comments). The description adds no parameter-specific information beyond what's in the schema, such as explaining the 'event' enum values (APPROVE, REQUEST_CHANGES, COMMENT) in practical terms. Baseline 3 is appropriate since the schema does the heavy lifting.

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 'Create a review on a pull request' clearly states the action (create) and target resource (review on a pull request). It distinguishes this from sibling tools like 'add_issue_comment' or 'get_pull_request_reviews' by specifying creation rather than retrieval or commenting on issues. However, it doesn't explicitly differentiate from 'update_pull_request_branch' or other pull request-related tools beyond the basic verb+resource.

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 pull request access), when not to use it (e.g., for simple comments vs. formal reviews), or refer to sibling tools like 'get_pull_request_reviews' for checking existing reviews. Usage is implied by the name but not explicitly stated.

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

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

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