Skip to main content
Glama

create_pull_request_review

Submit code review feedback on GitHub pull requests by approving changes, requesting modifications, or adding comments to specific lines.

Instructions

Create a review for a pull request

Input Schema

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

Implementation Reference

  • Core handler function that executes the GitHub API call to create a pull request review.
    export async function createPullRequestReview(
      github_pat: string,
      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(
        github_pat,
        `https://api.github.com/repos/${owner}/${repo}/pulls/${pullNumber}/reviews`,
        {
          method: 'POST',
          body: options,
        }
      );
      return PullRequestReviewSchema.parse(response);
    }
  • Input schema definition for the create_pull_request_review tool parameters.
    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")
    });
  • Extended schema including GitHub PAT, used for argument parsing in the tool handler.
    export const _CreatePullRequestReviewSchema = CreatePullRequestReviewSchema.extend({
      github_pat: z.string().describe("GitHub Personal Access Token"),
    });
  • src/index.ts:195-199 (registration)
    Tool registration in the list of available tools, specifying name, description, and input schema.
    {
      name: "create_pull_request_review",
      description: "Create a review for a pull request",
      inputSchema: zodToJsonSchema(pulls.CreatePullRequestReviewSchema),
    },
  • MCP server dispatch handler case that parses arguments and calls the core createPullRequestReview function.
    case "create_pull_request_review": {
      const args = pulls._CreatePullRequestReviewSchema.parse(params.arguments);
      const { github_pat, owner, repo, pull_number, ...options } = args;
      const result = await pulls.createPullRequestReview(github_pat, owner, repo, pull_number, options);
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Create a review' implies a write operation that likely requires permissions and affects pull request status, but the description doesn't mention authentication needs, rate limits, side effects (e.g., notifications), or what happens on success/failure. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 waste—'Create a review for a pull request' is front-loaded and directly states the action. Every word earns its place, making it easy to parse quickly without 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?

Given the complexity (7 parameters, mutation tool) and lack of annotations or output schema, the description is incomplete. It doesn't cover behavioral aspects like permissions, side effects, or return values, leaving gaps for the agent to infer. For a tool that creates reviews—a potentially impactful operation—more context is needed to ensure correct usage.

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 already documents all 7 parameters thoroughly (e.g., 'owner', 'event' with enum values). The description adds no additional meaning beyond the schema—it doesn't explain parameter relationships, defaults, or usage examples. Baseline 3 is appropriate when the schema does the heavy lifting, but the description doesn't compensate or enhance understanding.

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 for a pull request' clearly states the verb ('create') and resource ('review for a pull request'), making the purpose immediately understandable. It distinguishes from sibling tools like 'submit_pull_request_review' (which likely finalizes a review) and 'dismiss_pull_request_review' (which removes one). However, it doesn't specify what a 'review' entails (e.g., approval, comments, changes), which keeps it from a perfect score.

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), differentiate from similar tools like 'add_issue_comment' or 'submit_pull_request_review', or specify contexts (e.g., code review workflows). Without any usage context, the agent must infer from the name and schema 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/MissionSquad/mcp-github'

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