Skip to main content
Glama

git_worktree_switch

Switch to an existing git worktree by ticket ID, branch, or path to move context between tickets. Returns the worktree path.

Instructions

Hop to an existing git worktree by ticket ID, branch name, or path. Use this to switch context to a different ticket. Returns the worktree path. IMPORTANT: After calling this tool, you MUST immediately run the cd command from suggestedCommands to change the working directory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugNoCombined with ticket to find a specific worktree when multiple exist for one ticket.
branchNoBranch name to find the worktree for.
ticketNoTicket ID to find the worktree for (matches against branch names).
repoPathNoAny path inside the git repository.
worktreePathNoDirect path to the worktree directory.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/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 it does disclose two real traits: the tool returns a path rather than changing the shell's cwd, and the agent MUST subsequently run the cd from suggestedCommands. It stops short of describing failure behavior or whether the operation mutates anything.

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?

Four short sentences, front-loaded with the action and lookup keys, then usage, return value, and the critical follow-up. Minimal waste, though sentence two lightly restates sentence one.

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?

No output schema, and the description compensates by stating the return value (worktree path) and the mandatory cd follow-up. With all parameters optional, it still lacks guidance on precedence when multiple keys are supplied, but covers the essentials for invoking the tool correctly.

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% with per-parameter descriptions, so the schema already documents all five parameters. The description's listing of ticket/branch/path mirrors the schema without adding format, precedence, or mutual-exclusivity rules across those lookup keys.

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 (switch/hop) and resource (existing git worktree) and enumerates the three lookup keys, which distinguishes it from create/remove/list siblings. However it does not distinguish itself from the near-identical git_worktree_open sibling, leaving that boundary to the agent.

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?

"Use this to switch context to a different ticket" gives an implied usage context, and the IMPORTANT note prescribes a follow-up action. But it never says when to prefer this over git_worktree_open or what to do if the worktree is not found.

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