Skip to main content
Glama

Create pull request

gh_create_pr

Create a GitHub pull request from a head branch to a base branch, with optional labels, assignees, and reviewers.

Instructions

Additive write: create exactly one pull request from the specified bounded head and base selectors after ordinary write authorization. Optional labels, assignees, and review requests are bounded and read back when created. It does not approve, merge, or change another pull request.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseYesBase branch name.
bodyYesMarkdown pull request body.
headYesHead branch or owner:branch selector.
repoYesGitHub repository name without the owner prefix.
draftNo
ownerYesGitHub repository owner or organization login.
titleYesPull request title.
labelsNoOptional labels to apply.
assigneesNoOptional GitHub user logins or the @me selector to assign.
review_usersNoOptional GitHub user logins to request for review.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
titleYes
numberYes
messageYes
warningNo
request_idNo
write_completedYes
readback_completedYes
precondition_checkedYes
state_matches_requestedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed33 schema fields changedv0.8.1
    • changedInput schema / properties / assignees / anyOf
      Previous value: -[
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "items": {
      +      "maxLength": 39,
      +      "minLength": 1,
      +      "pattern": "^(?:@me|[A-Za-z0-9](?:[A-Za-z0-9-]{0,38}))$",
      +      "type": "string"
      +    },
      +    "maxItems": 10,
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / assignees / description
      Added value: +"Optional GitHub user logins or the @me selector to assign."
    • addedInput schema / properties / base / description
      Added value: +"Base branch name."
    • addedInput schema / properties / base / maxLength
      Added value: +1024
    • addedInput schema / properties / base / minLength
      Added value: +1
    • addedInput schema / properties / body / description
      Added value: +"Markdown pull request body."
    • addedInput schema / properties / body / maxLength
      Added value: +65536
    • addedInput schema / properties / head / description
      Added value: +"Head branch or owner:branch selector."
    • addedInput schema / properties / head / maxLength
      Added value: +1024
    • addedInput schema / properties / head / minLength
      Added value: +1
    • changedInput schema / properties / labels / anyOf
      Previous value: -[
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "items": {
      +      "maxLength": 100,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "maxItems": 100,
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / labels / description
      Added value: +"Optional labels to apply."
    • addedInput schema / properties / owner / description
      Added value: +"GitHub repository owner or organization login."
    • addedInput schema / properties / owner / maxLength
      Added value: +39
    • addedInput schema / properties / owner / minLength
      Added value: +1
    • addedInput schema / properties / owner / pattern
      Added value: +"^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$"
    • addedInput schema / properties / repo / description
      Added value: +"GitHub repository name without the owner prefix."
    • addedInput schema / properties / repo / maxLength
      Added value: +100
    • addedInput schema / properties / repo / minLength
      Added value: +1
    • addedInput schema / properties / repo / pattern
      Added value: +"^[A-Za-z0-9_.-]{1,100}$"
    • changedInput schema / properties / review_users / anyOf
      Previous value: -[
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "items": {
      +      "maxLength": 39,
      +      "minLength": 1,
      +      "pattern": "^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$",
      +      "type": "string"
      +    },
      +    "maxItems": 100,
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / review_users / description
      Added value: +"Optional GitHub user logins to request for review."
    • addedInput schema / properties / title / description
      Added value: +"Pull request title."
    • addedInput schema / properties / title / maxLength
      Added value: +256
    • addedInput schema / properties / title / minLength
      Added value: +1
    • changedOutput schema / description
      Previous value: -"Result of creating a pull request."New value: +"Authoritative outcome of one pull-request creation attempt."
    • addedOutput schema / properties / precondition_checked
      Added value: +{
      +  "title": "Precondition Checked",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / readback_completed
      Added value: +{
      +  "title": "Readback Completed",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / request_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Request Id"
      +}
    • addedOutput schema / properties / state_matches_requested
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "title": "State Matches Requested"
      +}
    • addedOutput schema / properties / warning
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Warning"
      +}
    • addedOutput schema / properties / write_completed
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "title": "Write Completed"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "number",
      -  "title",
      -  "url",
      -  "message"
      -]New value: +[
      +  "precondition_checked",
      +  "write_completed",
      +  "readback_completed",
      +  "state_matches_requested",
      +  "number",
      +  "title",
      +  "url",
      +  "message"
      +]
  2. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already indicate readOnlyHint=false (write op), destructiveHint=false (non-destructive), and openWorldHint=true. The description adds important behavioral context: it is additive (creates exactly one PR), checks authorization, bounds optional inputs (labels, assignees, review requests), and reads them back when created. It also clarifies it does not approve, merge, or change other PRs, which goes beyond the annotations. No contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, two sentences, front-loaded with the main purpose and then additional context. It is efficient with no wasted words. Could structure the positive/negative statements slightly more explicitly, but it is well-sized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (10 params, mostly described in schema, and an output schema exists), the description covers the essential addition of behavioral boundaries (exactly one PR, bounded inputs, exclusion of other mutations). Since output schema exists, return values need no elaboration. The only minor gap is lack of usage prerequisites (e.g., need for auth, base branch existence), but that is acceptable.

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 90%, so most parameters already have descriptions. The tool description adds a little by mentioning 'bounded head and base selectors' and that optional labels/assignees/review requests are bounded and read back, but it does not add new meaning beyond the schema's existing parameter descriptions. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource ('create exactly one pull request from the specified bounded head and base selectors') and clearly distinguishes it from sibling tools by specifying it does not approve, merge, or change another pull request. This differentiates it from gh_merge_pr, gh_approve_pr, gh_set_pr_draft_state, and gh_edit_pr.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use this tool: when creating a PR, and explicitly states what it does not do (approve, merge, change another PR). However, it does not mention alternatives or any context for when to prefer this over other creation/edit tools. It provides no explicit when-not guidance or conditions like required permissions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.