Skip to main content
Glama

SCM create pull request

scm_create_pull_request
Destructive

Open a pull request with file changes on a GitHub repository, automatically (no confirmation) - the pull request is itself the human review gate. Use this in agent mode to land a pipeline-failure fix or other change as a reviewable PR: creates a new branch from the base branch, commits the files, and opens the PR. This tool is only available in agent mode; in ask mode, propose the change and ask the user to switch to agent mode. Requires the exact owner from github_list_repositories - never guess it.

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": "scm_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. 'fix/ci-build'). 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.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotency=false, but the description adds real context beyond them: it runs with no confirmation, the PR itself is the human review gate, and it mutates repo state by creating a branch and commit. The 'never guess the owner' warning flags an auth-relevant dependency not conveyed by annotations. It doesn't discuss failure modes like branch-already-exists or what the tool returns.

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?

Four sentences, front-loaded with the action and its most consequential behavioral trait (no confirmation), followed by the use case, the mode gate, and the owner prerequisite. Every sentence carries distinct information an agent needs; the parenthetical '(no confirmation)' earns its place as a safety signal.

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, destructive, no-output-schema tool, the description covers the mode gating, the composite write behavior, and the owner-source prerequisite. The one notable gap is return values: with no output schema, the agent isn't told whether it gets a PR number, URL, or branch name back, which it would need to reference the PR afterwards.

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 100%, so every parameter, including the subtle confirm_large_deletions guard and the whole-file replacement semantics of 'content', is already documented in structured form. The description adds only the workflow hint to source owner from github_list_repositories, which the owner field description largely repeats. Baseline 3 is appropriate.

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 uses a precise verb+resource ('Open a pull request with file changes on a GitHub repository') and then spells out the composite mechanics: creates a new branch from the base branch, commits the files, and opens the PR. That composite scope implicitly distinguishes it from plain PR-creation siblings like github_create_pull_request, but it never names a sibling explicitly, so it lands just short of a 5.

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?

It states the use case ('land a pipeline-failure fix or other change as a reviewable PR') and an explicit when-not with an alternative action: in ask mode, propose the change and ask the user to switch to agent mode. The agent knows both when to call it and what to do instead if mode gating blocks it.

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.