Skip to main content
Glama

scm_merge_pull_request

Destructive

Request that Ankra merge a pull request automatically once it goes green: the newest pipeline run for its head commit concludes success, any gate step passes, the run executed under approved (not fallback) authority, Ankra's AI review has not requested changes, and no human reviewer has requested changes. Requires the repository's GitHub connection to have Merge when green turned on and to be in Agent mode (both under AI settings, Connections; the connection's mode is not the chat's Ask/Agent switch); a fork pull request is never merged automatically. This tool only records the request (a merge-when-green intent) - it never merges immediately, and the merge itself happens later, asynchronously, once every condition holds. On a repository whose Ankra merge train is on (github_get_pull_request reports merge_train.repository_train), the request puts the pull request on the train once its checks pass, instead of merging it directly: this is how such a pull request gets the required 'Ankra merge train' check, and the train merges it once its tested car passes. A request already pending for the head is not repeated. Requires the exact owner and repo from a prior github_list_repositories call - never guess them - and the pull request's current head_sha.

Input Schema

NameRequiredDescriptionDefault
repoYesRepository name. Also accepts the combined 'owner/name' form.
ownerYesRepository owner (e.g. 'octocat'). Prefer the exact owner from a prior github_list_repositories call. May be embedded in 'repo' as 'owner/name'.
head_shaYesThe commit you are asking Ankra to merge when it goes green - the pull request's current head commit SHA.
providerYesSource control provider: 'github', 'gitlab' or 'bitbucket_cloud'. Only GitHub can actually be merged through Ankra today; a request on another provider is refused when the run gate is evaluated.
pull_request_numberYesThe pull request's number within the repository.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses that nothing merges synchronously, that the merge happens later and asynchronously once every gate holds, that duplicate pending requests for the same head are suppressed, and that the connection mode is not the chat's Ask/Agent switch. That last detail preempts a very likely agent misconfiguration. No contradiction with destructiveHint=true or idempotentHint=false.

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?

Every sentence carries substantive content and there is little filler, but the single most important fact for correct invocation (it only records an intent and never merges) sits in the third sentence behind a long gate-condition list. Front-loading that clause would improve it.

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

Completeness5/5

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

For a five-parameter, destructive, asynchronous mutation tool with no output schema and no annotations explaining preconditions, the description covers triggering conditions, prerequisites, failure modes, idempotency behavior, and the merge-train variant. An agent has what it needs to call this safely.

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

Parameters4/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, but the description adds real meaning: owner/repo must come from a prior github_list_repositories call and must never be guessed, and head_sha is explicitly 'the pull request's current head_sha'. It does not explain the provider enum's implication beyond what the schema already states.

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 ('Request that Ankra merge a pull request automatically once it goes green') and immediately disambiguates the surprising part: it records an intent rather than merging. An agent can tell this apart from github_create_pull_request or github_get_pull_request without opening a schema.

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?

Gives explicit preconditions (Merge when green on, Agent mode connection, approval-authority run, no requested changes), explicit exclusions (fork PRs never auto-merged, non-GitHub providers refused at gate evaluation), and requires owner/repo from a prior github_list_repositories call. It also names the alternate path for merge-train repos via github_get_pull_request's merge_train.repository_train.

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.

Resources