Skip to main content
Glama

git_switch

Switches the repository to an existing branch and lets Git block the checkout if local changes would be overwritten.

Instructions

Switch to an existing branch. Git refuses if it would overwrite local changes.

Input Schema

NameRequiredDescriptionDefault
nameYes
repoNo.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare non-read-only, non-destructive, non-idempotent. The description adds genuine value by disclosing the failure mode 'Git refuses if it would overwrite local changes', which goes beyond the annotations. However it does not say what happens to the working tree, whether the switch is reversible, or whether untracked files block the operation.

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?

Two short sentences, front-loaded with the core action and followed by the key constraint. No filler, though the second sentence could carry more operational detail at the same cost.

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?

An output schema exists, so return values need not be explained, and annotations cover the safety profile. But for a state-mutating git operation with two undocumented parameters, the description omits preconditions and parameter meaning that an agent needs to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden — but it mentions neither 'name' (branch identifier format) nor 'repo' (default '.' meaning current repository). An agent gets no guidance on what to pass, especially for the ambiguous 'repo' parameter.

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 and resource ('Switch to an existing branch') clearly enough that an agent can tell it apart from git_branch_create or git_stash_list. The word 'existing' usefully signals it does not create branches.

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 'existing branch' implies that git_branch_create is the tool for new branches, but no alternative or precondition (clean working tree, uncommitted changes) is stated explicitly. Usage is inferable rather than guided.

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