Skip to main content
Glama

code_worktree

Apply code edits in an isolated temporary git worktree, gate the change with a verification command, and commit to the current branch only when verification passes.

Instructions

Land a risky change safely: apply runs edits in a temp git worktree, your verify command gates it, and only on pass does the commit fast-forward into the CURRENT branch.

Input Schema

NameRequiredDescriptionDefault
actionNopreview default; apply: dry_run=false; status: list.
changesNoRequired for preview/apply: [{path, new_content, delete}].
dry_runNotrue = preview.
messageNoCommit message.
task_idYesTask id.
timeoutNoverify_cmd timeout ms.
request_idNoIdempotency key.
verify_cmdNoNon-zero = abort + rollback.
workspace_dirYesProject root (abs, git repo).
expected_state_revisionNoOptimistic guard.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.28

TDQS

A3.6/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose meaningful behavior: edits happen in an isolated temp worktree, the verify command gates the outcome, and the commit only fast-forwards to the current branch on pass. It omits auth/permission requirements, idempotency semantics (despite a request_id param), and the rollback-on-preview distinction, keeping it short of a 5.

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?

A single well-formed sentence that front-loads the value proposition and uses a colon to unpack the mechanism. Dense but zero filler; it does not waste space on restating the name.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter tool with three actions (preview/apply/status) and no output schema, the description addresses only the apply path. Preview and status modes — and what a caller should expect from them — are left entirely to the schema, leaving the multi-mode behavior under-explained.

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 every parameter is already documented, establishing a baseline of 3. The description reinforces the gating role of the verify command but adds no format or usage detail beyond what the schema states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a concrete mechanism (temp git worktree + verify gate + fast-forward commit into the CURRENT branch), which tells an agent exactly what the tool accomplishes. The verb is somewhat implicit ('apply runs edits') and it never names or contrasts with siblings like edit_transaction or code_patch, so differentiation falls short of a 5.

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

Usage Guidelines3/5

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

The phrase 'Land a risky change safely' implies the intended scenario (high-risk edits needing verification), which is useful implied guidance. However, there is no explicit when/when-not, and no routing to the alternative transaction/edit tools that occupy the same space.

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