Skip to main content
Glama
kunwarVivek

mcp-github-project-manager

create_pull_request_review

Submit a review on a GitHub pull request to approve changes, request modifications, or add comments for code collaboration.

Instructions

Create a review on a pull request (approve, request changes, or comment)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pullNumberYes
bodyNo
eventYes
commentsNo

Implementation Reference

  • Core handler implementation that executes the GitHub API call to create a pull request review using Octokit
    async createPullRequestReview(data: {
      pullNumber: number;
      body?: string;
      event: 'APPROVE' | 'REQUEST_CHANGES' | 'COMMENT';
      comments?: Array<{
        path: string;
        position?: number;
        body: string;
      }>;
    }): Promise<{ id: number; user: string; state: string; body: string }> {
      try {
        const octokit = this.factory.getOctokit();
        const config = this.factory.getConfig();
    
        const response = await octokit.rest.pulls.createReview({
          owner: config.owner,
          repo: config.repo,
          pull_number: data.pullNumber,
          body: data.body,
          event: data.event,
          comments: data.comments
        });
    
        return {
          id: response.data.id,
          user: response.data.user?.login || 'unknown',
          state: response.data.state,
          body: response.data.body || ''
        };
      } catch (error) {
        throw this.mapErrorToMCPError(error);
      }
    }
  • Tool definition including Zod input schema, description, and usage examples for validation
    export const createPullRequestReviewTool: ToolDefinition<CreatePullRequestReviewArgs> = {
      name: "create_pull_request_review",
      description: "Create a review on a pull request (approve, request changes, or comment)",
      schema: createPullRequestReviewSchema as unknown as ToolSchema<CreatePullRequestReviewArgs>,
      examples: [
        {
          name: "Approve PR",
          description: "Approve a pull request",
          args: {
            pullNumber: 42,
            event: "APPROVE",
            body: "LGTM! Great work on the authentication implementation."
          }
        },
        {
          name: "Request changes",
          description: "Request changes with inline comments",
          args: {
            pullNumber: 42,
            event: "REQUEST_CHANGES",
            body: "Please address the comments below",
            comments: [
              {
                path: "src/auth.ts",
                position: 15,
                body: "Consider using bcrypt for password hashing"
              }
            ]
          }
        }
      ]
    };
  • Registers the create_pull_request_review tool in the central ToolRegistry
    this.registerTool(createPullRequestReviewTool);
  • Main tool dispatch handler that routes tool calls to the service implementation
    case "create_pull_request_review":
      return await this.service.createPullRequestReview(args);
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. While 'create' implies a write operation, it doesn't disclose important behavioral traits: whether this requires specific permissions, if reviews are editable/deletable, rate limits, or what happens when multiple reviews are submitted. The description mentions the three event types but doesn't explain their consequences (e.g., APPROVE may merge the PR).

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 that front-loads the core purpose. Every word earns its place - 'create a review' establishes the action, 'on a pull request' specifies the context, and the parenthetical clarifies the three review types. No wasted words or redundant information.

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 4-parameter mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain the review creation process, expected responses, error conditions, or how parameters interact. While concise, it lacks the completeness needed for an agent to understand the full context of this write operation.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It only mentions the 'event' parameter's three possible values but doesn't explain what 'pullNumber', 'body', or 'comments' represent or how they relate to the review. No guidance on parameter interactions (e.g., when 'comments' array should be used with specific events) is provided.

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 ('create a review') and resource ('on a pull request'), specifying the three possible review types (approve, request changes, or comment). It distinguishes from sibling tools like 'create_issue_comment' or 'update_pull_request' by focusing specifically on pull request reviews. However, it doesn't explicitly differentiate from 'list_pull_request_reviews' beyond the verb difference.

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 access to the pull request), when to choose different event types, or how this differs from other comment/approval mechanisms. No explicit alternatives or exclusions are provided.

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/kunwarVivek/mcp-github-project-manager'

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