Skip to main content
Glama

submit_pull_request_review

Submit a pull request review to approve, request changes, or comment on GitHub code changes. Use this tool to provide feedback on pull requests within repositories.

Instructions

Submit a pull request review (approve, request changes, or comment)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner (username or organization)
repoYesRepository name
pull_numberYesPull request number
review_idYesThe ID of the review
eventYesThe review action to perform
bodyNoThe body text of the review submission

Implementation Reference

  • The core handler function that executes the tool logic by making a POST request to the GitHub API to submit a pull request review.
    export async function submitPullRequestReview(
      github_pat: string,
      owner: string,
      repo: string,
      pullNumber: number,
      reviewId: number,
      event: 'APPROVE' | 'REQUEST_CHANGES' | 'COMMENT',
      body?: string
    ): Promise<z.infer<typeof PullRequestReviewSchema>> {
      const response = await githubRequest(
        github_pat,
        `https://api.github.com/repos/${owner}/${repo}/pulls/${pullNumber}/reviews/${reviewId}/events`,
        {
          method: 'POST',
          body: {
            event,
            body,
          },
        }
      );
      return PullRequestReviewSchema.parse(response);
    }
  • Input schema definitions for validating the tool parameters, including the public schema and internal schema with GitHub PAT.
    export const SubmitPullRequestReviewSchema = 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"),
      review_id: z.number().describe("The ID of the review"),
      event: z.enum(['APPROVE', 'REQUEST_CHANGES', 'COMMENT']).describe("The review action to perform"),
      body: z.string().optional().describe("The body text of the review submission")
    });
    
    export const _SubmitPullRequestReviewSchema = SubmitPullRequestReviewSchema.extend({
      github_pat: z.string().describe("GitHub Personal Access Token"),
    });
  • src/index.ts:201-204 (registration)
    Tool registration in the list of available tools, defining name, description, and input schema.
      name: "submit_pull_request_review",
      description: "Submit a pull request review (approve, request changes, or comment)",
      inputSchema: zodToJsonSchema(pulls.SubmitPullRequestReviewSchema),
    },
  • src/index.ts:597-606 (registration)
    Dispatch handler in the switch statement that parses arguments and calls the submitPullRequestReview function.
    case "submit_pull_request_review": {
      const args = pulls._SubmitPullRequestReviewSchema.parse(params.arguments);
      const { github_pat, owner, repo, pull_number, review_id, event, body } = args;
      const result = await pulls.submitPullRequestReview(
        github_pat, owner, repo, pull_number, review_id, event, body
      );
      return {
        content: [{ type: "text", text: JSON.stringify(result, 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/MissionSquad/mcp-github'

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