Skip to main content
Glama
saitolume

git-mcp-server

by saitolume

git-mcp-server: Create branch

git_switch_create

Create and switch to a new local branch from an exact expected branch and HEAD, rejecting any mismatch or dirty state.

Instructions

Operation: Create and switch to one new branch from the exact expected_branch and exact expected HEAD. Returns: request_id, repository_id, the created branch, and unchanged head; no session identifier. Defaults: a string expected_branch requires that attached branch, while null requires detached HEAD. Excludes: existing branch checkout, force or reset, branch or HEAD mismatch, dirty or untracked state, and remote access.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchYesNew local branch name to create from the exact expected HEAD; existing or invalid refs are rejected.
repositoryYesAbsolute path to the exact target Git worktree for this mutation.
request_idYesClient-generated UUID that makes this mutation durable and idempotent for exact replay.
expected_headYesExact current local HEAD object ID expected before mutation; mismatch rejects without Git mutation.
expected_branchYesExact current local branch expected before branch creation, or null to require detached HEAD; mismatch rejects without Git mutation.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
errorNo
statusYes
warningsYes
operationYes
request_idNo
repository_idNo
observed_afterNo
observed_beforeNo
Behavior4/5

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

With all annotations set to false, the description adds significant behavioral context: returns, default behavior (string vs null for expected_branch), and conditions for rejection (mismatch, dirty state). It does not claim idempotency, consistent with annotations. The description reveals the mutation's preconditions and side effects.

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?

The description is a single dense paragraph with clear sections (Operation, Returns, Defaults, Excludes). Every sentence carries essential information, with no repetition or filler.

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 the tool's complexity (5 required params, output schema present), the description covers operation, return values, default behavior, and failure conditions. The output schema handles return details, so the description is complete for agent decision-making.

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%, but the description adds value by explaining the default behavior for expected_branch ('string requires attached branch, null requires detached HEAD') and clarifying the branch parameter's purpose 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?

The description clearly states the verb ('Create and switch') and resource ('one new branch') with precise conditions ('from the exact expected_branch and exact expected HEAD'). It distinguishes from sibling tools by specifying that it only creates a new branch from a specific state, excluding checkout, merge, etc.

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?

The description explicitly lists what is excluded (existing branch checkout, force/reset, mismatch, dirty state, remote access), providing clear when-not-to-use guidance. However, it does not explicitly name alternatives like git_commit or git_merge, though the exclusions implicitly differentiate.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/saitolume/git-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server