Skip to main content
Glama

Create and switch to a new git branch

git_git_create_branch

Create and switch to a new git branch from the current commit, preserving uncommitted changes while isolating work from current branch history. Use only for new branch names.

Instructions

Create a new git branch from the current commit and switch to it.

Calls repo.create_head(branch_name) then branch.checkout(); uncommitted changes carry over onto the new branch, and live /config files now follow it.

Use when: starting an isolated set of changes without touching the current branch's commit history. Not for: switching to a branch that already exists — use git_git_checkout_branch. Returns: dict {"status": "created_and_checked_out", "branch": ...}. Errors: raises an exception from gitpython when a branch named branch_name already exists; raises RuntimeError (from _repo()) when no git repo exists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branch_nameYesName of the new git branch to create, e.g. 'automation-refactor'.

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 the new git branch to create, e.g. 'automation-refactor'."
  2. First observedv0.3.0

TDQS

A4.6/5.0
Behavior5/5

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

Adds substantial context beyond annotations: uncommitted changes carry over, live /config files follow the branch, implementation calls repo.create_head then checkout, and error conditions are documented. Annotations cover the safety profile, but the description enriches behavioral understanding significantly.

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?

Front-loads the main action and uses clear sections for usage, returns, and errors. The Returns line is redundant given an output schema exists, but overall the description is tight and earns its length.

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?

Covers purpose, usage alternatives, side effects, return shape, and failure modes for a one-parameter mutation tool. With annotations and an output schema also present, nothing material is missing.

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% and the single parameter branch_name is fully described in the schema with an example. The description only references branch_name in error context, adding little semantic detail beyond the schema.

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 (create) and resource (git branch) plus the side effect (switch to it). It explicitly excludes existing branches and names git_git_checkout_branch, so an agent can distinguish it from the sibling.

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?

Provides explicit when-to-use ('starting an isolated set of changes...') and when-not ('switching to a branch that already exists'), naming the alternative tool. No inference is required.

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