Skip to main content
Glama

merge_pull_request

Merge a pull request in Gitea using a chosen strategy (merge, squash, rebase, or rebase-merge), with optional custom commit message and SHA verification to prevent branch drift.

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
Behavior4/5

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

No annotations provided, so description carries full burden. It explicitly states IRREVERSIBLE, details merge strategies, and mentions failure conditions (SHA guard). Could add more on auth requirements or rate limits, but covers essential destructive behavior.

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?

Two information-dense sentences with no wasted words. Purpose, parameters, and warning are all front-loaded.

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?

Covers essential behavioral aspects, safety warnings, and includes cross-references to sibling tools. No output schema exists, but the description is complete given the tool's complexity.

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 baseline is 3. Description repeats strategy enum meanings and mentions SHA guard, but does not add significant new info beyond schema.

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 'Merge a pull request by index' with a specific verb and resource. It distinguishes from siblings like get_pull_request and is_pull_merged by explicitly mentioning them in guidelines.

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?

Provides explicit when-to-use and when-not-to-use guidance: 'IRREVERSIBLE — confirm ... with the user BEFORE merging. Check is_pull_merged first if unsure.' It also mentions alternatives like get_pull_request for checking mergeable status.

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