Skip to main content
Glama

gluecron_apply_patch

Commit a patch to a branch without sending whole files — the way to change a few lines of a large file. patch is a unified diff as git diff prints it (one commit, message required) OR git format-patch mbox output (each patch becomes its own commit with the patch's own message and author, like git am; message is ignored). Applied server-side with git apply --cached against the branch head (created from base_branch if missing); blank context lines a transport stripped to empty lines, or trimmed off the end of the patch, are restored first (git still checks them against the file). expected_head_sha makes it compare-and-swap (all zeros = branch must not exist yet). Meets the same branch protection, rulesets and secret scan as a git push, and fires CI/webhooks like one. Patch limit 2 MiB. Requires 'repo' scope. Returns {branch, commit_sha, parent_sha, files_changed, files, commits, created} (+ blank_context_lines_restored / trimmed_blank_context_lines_restored when a repair was needed).

Input Schema

NameRequiredDescriptionDefault
repoYes
ownerYes
patchYesUnified diff (`git diff`, a/ b/ prefixes) or `git format-patch` mbox text. Max 2 MiB.
branchYesTarget branch (short name). Created if it does not exist.
messageNoCommit message. Required for a unified diff; ignored for mbox input (each patch carries its own).
base_branchNoBranch to fork from when `branch` does not exist yet (default: the repo's default branch).
expected_head_shaNoOptional compare-and-swap: the 40-hex sha you expect `branch` to point at. Refused if it moved. All zeros = the branch must not exist.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes far beyond the annotations (readOnlyHint=false, destructiveHint=false): discloses server-side `git apply --cached` against branch head, branch creation from `base_branch`, blank-context-line restoration, compare-and-swap semantics, branch protection/ruleset/secret-scan enforcement, CI/webhook firing, 2 MiB limit and required 'repo' scope.

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?

Front-loads the core purpose and keeps every sentence information-bearing with no filler. However, it is one dense parenthesis-heavy paragraph, and a bulleted split of format rules vs side effects would be easier to scan.

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 complex mutation tool with no output schema, the description covers the safety/side-effect profile, permission scope, size limit, failure-relevant CAS behavior, and even enumerates returned fields. Nothing an agent needs to call it correctly is missing.

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 71%, and the description reinforces/interprets key parameters: `message` required vs ignored by format, `expected_head_sha` all-zeros meaning 'branch must not exist', and `base_branch` as the fork point. It adds interaction semantics beyond the schema, though much of it partially duplicates existing 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?

States a specific verb and resource ('Commit a patch to a branch') and immediately distinguishes the mechanism from alternatives: 'without sending whole files — the way to change a few lines of a large file.' An agent can tell it apart from write_file / atomic_multi_file_commit without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explains precisely when each input format applies: unified diff = one commit with `message` required, format-patch mbox = one commit per patch with own message/author and `message` ignored. The 'change a few lines of a large file' framing implies when to prefer it over whole-file writes, but sibling tools are never named as alternatives.

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