Skip to main content
Glama

git_worktree

Apply multi-file changes on an isolated git branch, auto-commit and merge, with rollback on any failure.

Instructions

Multi-file changes on isolated git branch: zero working-tree pollution, auto commit + ff-merge, verify_cmd. Rollback on failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
changesYesREQUIRED: list of file changes to apply transactionally
messageNoCommit message (default: tongtian: multi-file change (N files))
timeoutNoGit command timeout in ms (default: 30000, min 1000)
verify_cmdNoOptional shell command run in the worktree before commit; non-zero exit aborts and rolls back
workspace_dirYesREQUIRED: project root (abs). Must be a git repository.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries full burden. It discloses key behaviors: changes are made on an isolated branch, committed and fast-forward merged, verification via verify_cmd can abort and rollback on failure. This is substantial disclosure for a mutation tool, though it doesn't detail rollback mechanics or return values.

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 concise sentence with a colon and list, conveying purpose, benefits, and safety features. Every phrase adds value, with no wasted words.

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

Completeness4/5

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

The description covers the core workflow (multi-file changes, commit, merge, verify, rollback) but doesn't specify the return value or the exact lifecycle of the worktree/branch. Given no output schema or annotations, this is a minor gap but overall sufficient.

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 coverage is 100%, so baseline is 3. The description mentions verify_cmd and rollback, but the schema already documents each parameter thoroughly. The description adds no new parameter meaning beyond the 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 the tool applies multi-file changes on an isolated git branch with auto commit and ff-merge, including verification and rollback. It distinguishes itself from generic edit tools by specifying the worktree isolation and safety mechanisms.

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?

The description implies usage for transactional multi-file changes that should not pollute the working tree, with verification via verify_cmd. It doesn't explicitly name alternatives or exclusions, but the mention of isolated branch and zero pollution provides clear context for when to prefer this tool.

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

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/wulun811/LiuHe'

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