Skip to main content
Glama

branch_switch

Switch to a local branch only when the working tree and index are clean, preventing loss of uncommitted changes.

Instructions

Switch to a valid local branch only when the worktree and index are clean.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branch_nameYes
repository_pathYes
declaration_pathNoarchitecture.yaml

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the behavioral disclosure burden. It discloses an important guard: switching is permitted only on a clean worktree/index, implying refusal or failure on dirty state. However, it does not say what happens on violation or describe other side effects, permissions, or output behavior.

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

Conciseness5/5

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

A single, front-loaded sentence with no filler. The key action is stated first, followed by a concise condition that earns its place.

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?

For a simple switch operation, the core guard and required parameters are clear, and the presence of an output schema reduces the need to describe return values. Still, the meaning and necessity of declaration_path are omitted, and there is no mention of what to do when the worktree is dirty.

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 needed to explain parameters. It adds some meaning to branch_name by requiring it to be a valid local branch, but says nothing about repository_path or declaration_path. The optional declaration_path parameter is especially unexplained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a precise verb and resource: switch to a valid local branch. The added condition 'only when the worktree and index are clean' clarifies scope and differentiates it from siblings like branch_create or repository_branches.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

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

It gives a clear precondition for use—only when the worktree and index are clean—which tells an agent the state a repository must be in before invoking this tool. It does not explicitly name alternatives or exclusions, but the context is sufficiently clear.

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