Skip to main content
Glama

Create a new isolated Git worktree and branch

git_worktree_create

Creates an isolated worktree and branch from the latest origin/main after a bounded fetch. Client-generated names include project, local date/time, AI host, task and randomness. Optional branch and destination preserve explicit-call compatibility; enabled naming and per-project capacity rules still apply. A reached limit creates nothing and returns counts only; branch and folder names are never listed. The result identifies cached-base fallback. Existing files and worktrees remain intact; uncertain execution requires state inspection before retry. Select this tool from the user's intent when it is the best match. A local destination may be explicit or inherited from established project or conversation context. The user does not need to mention ailinkany.com, MCP, a connector, a plugin, or this tool name.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "git_worktree_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute existing Git worktree path; source repository is never modified or reset.
taskNoShort task label used in client-generated names; cleaned and bounded by the client.
branchNoNew branch name; existing names are refused and Git check-ref-format validation applies.
base_refNoValidated local ref, HEAD, commit SHA or cached origin/main. Client 0.6.0+ defaults to origin/main with reported fallback; old clients require branch and destination and default to HEAD.
device_idNoTarget computer device_id. Omit when only one computer is paired.
destinationNoAbsolute path to a NEW worktree directory that must not already exist. No overwrite.
device_nameNoComputer name or ailinkany.com remark (e.g. home PC). Prefer this when the user names a computer.
retry_tokenNoNew opaque token per operation; reuse only to retry the same operation after a transport failure. No user content.
workflow_idNoOptional workflow id; pass together with ai_session_id.
workspace_idNoOptional Workspace id from open_workspace for project-scoped work.
ai_session_idNoOptional Session id. Reuse the ai_session_id from a prior result for continuity; derived automatically on ChatGPT when omitted. Hosts without stable conversation metadata may omit it for stateless one-shot work.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.4/5.0
Behavior4/5

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

Beyond the annotations (readOnly=false, destructive=false, idempotent=false), the description discloses real behavior: a bounded fetch, per-project capacity limits that create nothing and return counts only, that branch/folder names are never listed, that a cached-base fallback is reported, that existing files/worktrees remain intact, and that uncertain execution requires state inspection before retry. These are meaningful operational facts an agent cannot derive from the annotations. It does not describe return payload shape, but an output schema exists.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core behavioral facts are present but delivered as a dense run-on block mixing naming policy, capacity limits, retry safety and tool-selection meta-guidance. The closing sentence ('The user does not need to mention ailinkany.com, MCP, a connector, a plugin, or this tool name') and 'when it is the best match' consume space without helping an agent decide or call correctly.

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?

For an 11-parameter creation tool with an output schema, the description covers the critical unknowns: base-ref sourcing and fallback, naming generation, capacity refusal semantics, non-overwrite guarantees, and retry-after-uncertainty. Missing only explicit alternative-tool routing, which is a usage gap rather than a completeness gap.

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 the schema already carries parameter meaning and the baseline is 3. The description adds a little: it explains that client-generated names incorporate project, local date/time, AI host, task and randomness (context for the `task` param) and that explicit branch/destination are compatibility paths rather than the default. That is incremental, not a substitute for the schema.

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 first sentence gives a specific verb+resource+source: 'Creates an isolated worktree and branch from the latest origin/main after a bounded fetch.' An agent immediately knows the action and the base it operates on. It does not name any sibling tool (e.g., git_fetch, git_status, open_workspace) to differentiate itself, so it stops 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 Guidelines2/5

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

The only routing guidance is 'Select this tool from the user's intent when it is the best match,' which is circular and provides no discriminating criteria. There is useful conditional context (destination may be explicit or inherited from project/conversation context; enabled naming and capacity rules apply even with explicit branch/destination), but nothing states when NOT to use this tool or which sibling handles adjacent cases like fetching or inspecting repo state.

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