Skip to main content
Glama

Switch config to an existing branch

git_git_checkout_branch
DestructiveIdempotent

Switch the Home Assistant config repository to an existing branch, updating live /config files to that branch's committed version. Use to load prepared branch-based configurations.

Instructions

Switch the HA config git repository to an existing branch.

Calls repo.git.checkout(branch_name), which replaces every tracked file under /config with that branch's committed version — the live configuration Home Assistant reads from changes as soon as this returns.

Use when: switching between prepared configurations that are tracked as branches. Not for: creating a branch that does not exist yet — use git_git_create_branch. Returns: dict {"status": "switched", "branch": ...}. Errors: raises an exception from gitpython when branch_name does not exist, or when uncommitted local changes would conflict with the target branch's files; raises RuntimeError (from _repo()) when no git repo exists. Limits: no confirm parameter; a conflicting uncommitted change blocks the checkout rather than being silently discarded (plain git behaviour), but a non-conflicting one carries over onto the new branch.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branch_nameYesName of an existing git branch to switch the config repository to.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.25.1
    • addedInput schema / properties / branch_name / description
      Added value: +"Name of an existing git branch to switch the config repository to."
  2. First observedv0.3.0

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing the destructive consequence ('replaces every tracked file under /config... the live configuration Home Assistant reads from changes as soon as this returns'), the error surface (gitpython exception on missing branch, RuntimeError when no repo exists), and the limit that a conflicting uncommitted change blocks the checkout while a non-conflicting one carries over. This is exactly the kind of context annotations alone cannot convey.

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?

Front-loaded with the core behavior, then cleanly sectioned into Use when / Not for / Returns / Errors / Limits. Every line carries information; the invocation detail reinforces rather than wastes space.

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

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given a single-param schema, full annotations, and the presence of an output schema, the description covers behavior, routing, return shape, error modes, and destructive limits. Nothing needed to call it safely is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning about branch_name's constraints: it must exist, and a nonexistent value raises a gitpython exception. That error semantics around the single parameter is useful value beyond the schema's plain description.

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?

States a specific verb and resource ('Switch the HA config git repository to an existing branch') and immediately names the sibling it is not ('use git_git_create_branch'). An agent can distinguish it from create_branch without opening either schema.

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

Usage Guidelines5/5

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

Explicit 'Use when: switching between prepared configurations tracked as branches' and 'Not for: creating a branch that does not exist yet — use git_git_create_branch'. This gives both the positive trigger and the named alternative, leaving nothing to inference.

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

Deploy Server

Other Tools