Skip to main content
Glama

SCM merge pull request

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.

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": {
      "provider": "<provider>",
      "owner": "<owner>",
      "repo": "<repo>",
      "pull_request_number": "<pull_request_number>",
      "head_sha": "<head_sha>"
    },
    "name": "scm_merge_pull_request"
  }
}

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?

Beyond the annotations (destructiveHint=true, idempotentHint=false), the description discloses the full merge gate (newest pipeline run success, gate step, approved authority, AI review, human review), that execution is asynchronous and never immediate, that a pending request for the same head is not repeated, and the merge-train diversion path. This is exactly the behavioral context annotations cannot express.

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?

It is a dense single block, but it is front-loaded with the core action and every clause carries non-redundant information (gate conditions, async caveat, train behavior, sourcing rules). Breaking it into short labeled clauses would improve scanability, which is why it is not a 5.

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 action with no output schema, the description covers triggering conditions, refusal cases, timing, idempotency, and alternative merge-train outcomes. An agent has everything needed to call it correctly and to set expectations about the return semantics.

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: head_sha must be the pull request's *current* head, and owner/repo must be taken verbatim from a prior github_list_repositories call rather than inferred. It does not add format or syntax detail, so it stops short of 5.

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 uses a specific verb + resource and states precisely that the tool *records a merge-when-green intent* rather than merging now. It distinguishes itself from adjacent actions by naming the settings involved (Merge when green, Agent mode) and by referencing github_get_pull_request's merge_train field, so an agent can separate this from enable_merge_when_green or a direct merge.

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 gives explicit preconditions (GitHub connection with Merge when green on, Agent mode), explicit exclusion (fork PRs are never merged automatically, and non-GitHub providers are refused at gate evaluation), and explicit data-sourcing rules (owner/repo must come from a prior github_list_repositories call, never guessed; head_sha must be the current head). It also tells the agent to check github_get_pull_request for merge_train to predict train vs. direct-merge behavior.

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.