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); 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}.

Input Schema

TableJSON 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?

With annotations covering only readOnlyHint/destructiveHint, the description carries the load and delivers: git apply --cached against branch head, compare-and-swap via expected_head_sha (all-zeros = branch must not exist), same branch-protection/ruleset/secret-scan path as a push, CI/webhook firing, a 2 MiB limit, and the 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?

Single dense paragraph, front-loaded with purpose before mechanics; nearly every clause carries new information (formats, CAS, protections, limits). It is long and packs many distinct facts, but no sentence is filler.

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?

No output schema exists, yet the description enumerates the return shape ({branch, commit_sha, parent_sha, files_changed, files, commits, created}) and covers auth scope, size limit, and branch-creation behavior — everything an agent needs to invoke and interpret it.

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?

Adds real meaning beyond the 71%-covered schema, especially for `patch` (a/ b/ prefixed git diff vs format-patch mbox, where each patch becomes its own commit with its own message/author) and the interaction with `message`. It largely mirrors the schema on base_branch/expected_head_sha rather than extending them.

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+resource (commit a patch to a branch) and immediately scopes it against the whole-file alternative ('without sending whole files'), which distinguishes it from write_file and atomic_multi_file_commit without opening either schema.

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?

Gives clear when-to-use context: it is 'the way to change a few lines of a large file', and it distinguishes the two input modes (unified diff where message is required vs mbox where message is ignored). It does not explicitly name a sibling tool as the fallback for whole-file commits, so it stops short of full when/when-not/alternatives guidance.

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