Skip to main content
Glama

create_pull_request_review

Submit detailed reviews on GitHub pull requests, including feedback, comments, and approval status, to ensure code quality and collaboration within repositories.

Instructions

Create a review for 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 core handler function that performs the GitHub API POST request 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 defining parameters for creating a pull request review, used in tool registration and validation.
    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") });
  • src/index.ts:196-198 (registration)
    Tool registration in the listTools handler, defining name, description, and input schema.
    name: "create_pull_request_review", description: "Create a review for a pull request", inputSchema: zodToJsonSchema(pulls.CreatePullRequestReviewSchema),
  • Dispatcher case in the main CallToolRequest handler that parses arguments and delegates to the pulls.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) }], }; }
  • Extended schema including the GitHub PAT, used for internal parsing in the dispatcher.
    export const _CreatePullRequestReviewSchema = CreatePullRequestReviewSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });

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