Skip to main content
Glama

git_switch

Destructive

Switches to an existing branch or creates a new one from a given start point, without forcing changes or stashing work.

Instructions

Switch or create a branch without force or automatic stash.

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": "git_switch"
  }
}

Input Schema

NameRequiredDescriptionDefault
branchYes
createNo
start_pointNo

Output Schema

NameRequiredDescriptionDefault
errorNo
changesYes
updatesNo
conflictsYes
operationYes
head_afterYes
head_beforeYes
process_idsYes
synchronization_errorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.1

TDQS

C2.9/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the mutation risk is covered structurally. The phrase "without force or automatic stash" adds genuine behavioral context beyond the annotations: it signals that a dirty working tree will likely block the switch rather than being stashed automatically. However, it says nothing about detached HEAD states, remote-tracking branches, or what happens to uncommitted changes.

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 short sentence with no filler, and the primary purpose is front-loaded. It is arguably too terse given the undocumented parameters, but nothing is wasted.

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

Completeness2/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 described, and annotations cover the safety profile. But for a destructive, three-parameter tool with zero schema description coverage, the description leaves the meaning of `create` and `start_point` entirely unexplained and offers no guidance on the failure mode hinted at by "no automatic stash".

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, yet it never explains what `create` does, what `start_point` means (e.g. commit/branch to base the new branch on), or that `start_point` is only meaningful with `create`. The word "create" in the description loosely maps to one parameter but gives no usable semantics.

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?

"Switch or create a branch" gives a specific verb and resource, and the negation clause hints at scope. It does not however distinguish itself from the sibling git_branch tool, which an agent could reasonably confuse with this one.

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 explicit when-to-use or when-not-to-use guidance, and no mention of the sibling git_branch as an alternative. The only implied guidance is that force-switching and auto-stashing are unavailable, leaving the agent to infer the rest.

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