Skip to main content
Glama
MCP Git Server

MCP Git Server

by mpfilbin

git_checkout

Switch branches or restore working tree files in a Git repository, optionally creating a new branch first. Use it to move between refs or recover files from a specific commit.

Instructions

Switch branches or restore working tree files

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": {
      "ref": "<ref>"
    },
    "name": "git_checkout"
  }
}

Input Schema

NameRequiredDescriptionDefault
refYesThe branch name, tag, or commit to checkout
repoPathNoPath to git repository (defaults to current directory)
createBranchNoCreate a new branch before checking out

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden, yet it discloses nothing about hazards. It does not mention that restoring files can overwrite or discard local modifications, that switching branches fails with conflicting uncommitted changes, or that a tag/commit ref results in a detached HEAD. For a state-changing operation this is a substantial gap.

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?

One short, front-loaded sentence with no wasted words; both modes appear immediately. It is efficient but borders on under-specified given the tool's side effects.

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?

The tool is a potentially destructive git mutation with no annotations and no output schema, and the definition is a one-line man-page synopsis. It omits failure modes, detached-HEAD behavior, interaction with uncommitted work, and routing to alternatives, leaving an agent unable to call it safely on its own.

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 description coverage is 100%, so all three parameters (ref, repoPath, createBranch) are already documented in the schema. The description adds no additional meaning, such as the interaction between createBranch and ref, so the baseline of 3 applies.

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?

The description gives specific verbs ('switch', 'restore') and resources ('branches', 'working tree files'), which are the two distinct modes of checkout, so the agent knows roughly what the tool does. It stops short of distinguishing itself from siblings such as git_restore (which also restores working tree files) or git_branch_create, so it is clear but not differentiated.

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

Usage Guidelines3/5

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

Usage is only implied by the verb phrases; there is no explicit statement of when to pick this over git_restore for file restoration or git_branch_create for branch creation, even though the createBranch parameter clearly overlaps with the latter. The agent must infer the selection rules from sibling names alone.

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