Skip to main content
Glama

GitHub create pull request

github_create_pull_request
Destructive

Create a pull request with file changes in a GitHub repository. Prefer the exact owner from github_list_repositories; 'repo' also accepts the combined 'owner/name' form. Creates a new branch from the base branch, commits the specified files, and opens a PR. Use this instead of github_commit_files when changes should go through code review rather than being committed directly.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "owner": "<owner>",
      "repo": "<repo>",
      "title": "<title>",
      "head_branch": "<head_branch>",
      "files": "<files>",
      "commit_message": "<commit_message>"
    },
    "name": "github_create_pull_request"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyNoPull request description in markdown.
repoYesRepository name. Also accepts the combined 'owner/name' form.
draftNoIf true, create as a draft PR.
filesYesFiles to create or update. Each entry has a 'path' and 'content'.
ownerYesRepository owner (e.g. 'octocat'). Prefer the exact owner from a prior github_list_repositories call. May be embedded in 'repo' as 'owner/name'.
titleYesPull request title.
base_branchNoTarget branch to merge into. Defaults to the repository's default branch.
head_branchYesName for the new branch (e.g. 'feat/add-ci-pipeline'). Must not already exist.
commit_messageYesGit commit message for the changes.
confirm_large_deletionsNoPaths from 'files' whose new content is intentionally much shorter than the file it replaces. A commit that would replace an existing file with less than half of its content is refused unless that path is listed here. Leave this out unless a refusal named the path and removing that much is the change you intend.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / confirm_large_deletions
      Added value: +{
      +  "description": "Paths from 'files' whose new content is intentionally much shorter than the file it replaces. A commit that would replace an existing file with less than half of its content is refused unless that path is listed here. Leave this out unless a refusal named the path and removing that much is the change you intend.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / files / items / properties / content / description
      Previous value: -"File content as a string."New value: +"The COMPLETE new content of the file. The commit replaces the whole file with this string; it is not a patch, so anything left out is deleted."
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and non-idempotency, so the safety bar is partly met; the description still adds real context by disclosing that a new branch is created off the base branch before committing. It does not mention the large-deletion refusal guard or re-run behaviour, which would complete the picture for a destructive tool.

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?

Three short sentences, front-loaded with the core action and followed by scoping and alternative guidance; nothing is wasted. Minor redundancy with the schema on the owner/name form keeps it from a 5.

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?

For a 10-parameter mutation tool with full schema coverage and no output schema, the description covers action, side effects and tool selection. It omits what is returned (PR number/URL) and the behaviour when head_branch already exists, though the latter is documented in the schema.

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 coverage is 100%, so the baseline is 3. The description's only parameter remark — prefer the exact owner from github_list_repositories, and 'repo' also accepts 'owner/name' — largely restates what the owner and repo schema descriptions already say, adding no new semantics.

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?

States a specific verb and resource ('Create a pull request') plus a full workflow: new branch from base, commit files, open PR. It is immediately distinguishable from the sibling github_commit_files by the review-vs-direct framing.

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

Usage Guidelines5/5

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

Explicitly names the alternative (github_commit_files) and the condition that selects this tool over it ('when changes should go through code review rather than being committed directly'). It also gives routing guidance to github_list_repositories for the owner value.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.