Skip to main content
Glama

Create Git Worktree Workspace

worktree_create

Create a Git worktree for a branch and open it as a linked Herdr workspace for isolated terminal coding agent sessions.

Instructions

Create a Git worktree and open it as a linked Herdr workspace.

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": {
      "branch": "<branch>"
    },
    "name": "worktree_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNoSource Git repository directory path.
baseNoOptional base commit or ref.
pathNoOptional explicit target checkout path.
focusNoSwitch view to the new worktree workspace (default false).
labelNoOptional workspace label.
branchYesBranch name for the new worktree.
workspace_idNoSource workspace ID (mutually exclusive with cwd).
trust_repositoryNoGrant per-request Git repository trust only if the user explicitly verified the repository.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, idempotentHint=false and openWorldHint=false, so the safety profile is covered structurally. The description adds one genuinely useful behavioral fact beyond that — the worktree is opened as a linked workspace, i.e. the call has a UI/view side effect. It does not say what happens if the branch or target path already exists, nor when trust_repository is required.

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 front-loaded sentence with no filler; the primary action and its consequence are stated immediately. It is arguably under-sized for an 8-parameter creation tool, but nothing is redundant.

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?

The annotations cover reversibility/idempotency and the full schema documents inputs, so the description need not restate them; the core action and side effect are conveyed. However, for a mutating 8-parameter tool with no output schema, it omits what is created on disk, collision behavior, and when the trust_repository flag must be set.

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% and every parameter carries a description, including the mutual exclusivity of cwd/workspace_id and the default for focus, so the schema does the heavy lifting. The tool description adds no parameter-level meaning, which sets the baseline at 3.

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?

States a specific verb+resource ('Create a Git worktree') plus the resulting side effect ('open it as a linked Herdr workspace'), so the agent knows this both materializes a checkout and a workspace. It does not explicitly name workspace_create or worktree_list as the non-worktree alternatives, so sibling differentiation is left to inference.

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?

There is no when-to-use / when-not-to-use guidance: nothing says to prefer this over workspace_create for plain (non-worktree) workspaces, or over worktree_list for inspection. No prerequisites are stated (e.g. that a Git repo source is required, or that cwd/workspace_id are mutually exclusive besides the schema note).

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