Skip to main content
Glama

merge_pull_request

Merge a pull request with a chosen strategy: merge, squash, rebase, or rebase-merge. Confirm the PR's mergeability first, and optionally supply a custom title and message for the merge commit.

Instructions

Merge a pull request by index. Do selects the strategy: 'merge' (merge commit), 'squash' (single commit), 'rebase' (rebase + fast-forward), 'rebase-merge' (rebase + merge commit). Optional MergeTitleField/MergeMessageField customize the merge commit; SHA guards against branch drift. IRREVERSIBLE — confirm the index, strategy, and that the PR is mergeable (get_pull_request mergeable: true) with the user BEFORE merging. Check is_pull_merged first if unsure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
DoYesMerge strategy: 'merge' (merge commit), 'squash' (single commit), 'rebase' (rebase then fast-forward), 'rebase-merge' (rebase then merge commit)
SHANoThe expected HEAD SHA of the PR (fails if the branch moved since)
repoNoRepository name (defaults to GITEA_DEFAULT_REPO)
indexYesPull request number
ownerNoRepository owner (defaults to GITEA_DEFAULT_OWNER)
MergeTitleFieldNoTitle for the merge commit
MergeMessageFieldNoMessage body for the merge commit
Behavior5/5

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

With no annotations provided, the description fully bears the burden. It explicitly states the operation is 'IRREVERSIBLE', explains the side effects of each merge strategy, and notes that `SHA` guards against branch drift. No contradictions with annotations (none exist).

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?

The description is a single dense paragraph that is front-loaded with the core purpose, followed by strategy details, optional parameters, and warnings. Every sentence earns its place; there is no redundancy or extraneous text.

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?

Given the tool's complexity (7 parameters, 2 required, multiple strategies, irreversible action), the description covers all necessary aspects: purpose, parameter explanations, preconditions, and consequences. No output schema exists, but the description provides sufficient context for correct invocation.

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 baseline is 3. The description adds value by explaining the strategies ('merge' = merge commit, 'squash' = single commit, etc.) and clarifying that `SHA` prevents branch drift. It also notes that `MergeTitleField` and `MergeMessageField` customize the merge commit, going beyond the schema descriptions.

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 clearly states the tool's purpose: 'Merge a pull request by `index`.' It uses specific action verb 'merge' and identifies the resource 'pull request'. It distinguishes from sibling tools like create_pull_request and is_pull_merged by focusing on the merge action.

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?

The description provides explicit guidance: 'IRREVERSIBLE — confirm the index, strategy, and that the PR is mergeable... with the user BEFORE merging. Check is_pull_merged first if unsure.' It clearly states when to use and what prerequisites to verify, including an alternative check tool.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/amonstack/gitea_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server