Skip to main content
Glama

git_checkout

Checks out a branch only when protected paths and submodules remain unchanged, using the configured repository unless a valid repo path is supplied; operations follow project policy.

Instructions

Checkout only if no protected paths or submodules change. Omit repo_path to use the configured repository. Results and operations are restricted according to project policy.

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

Input Schema

NameRequiredDescriptionDefault
repo_pathNoOptional repository root. Omit to use the server's fixed repository. An explicit path must identify that same repository.
branch_nameYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2026.10.19

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false and destructiveHint=false. The description adds useful policy context (protected paths, submodules, project policy restriction) beyond the annotations, but does not say what happens on failure (abort vs. partial checkout) or how the working tree is affected.

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?

Three compact sentences with the key precondition front-loaded. No filler, though the policy sentence is somewhat vague.

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 mutation tool with no output schema and one undocumented parameter, the description covers the safety precondition but omits failure behavior, dirty-working-tree handling, and what the result looks like. Adequate but with clear gaps.

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 50%: repo_path is fully documented in the schema and the description merely restates its omit-default behavior. branch_name is undocumented in both schema and description, leaving its role (target branch vs. commit ref) to inference.

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 names the operation ('Checkout') and a scoping constraint, and the branch_name parameter makes the resource clear. It does not explicitly differentiate from siblings like git_restore or git_switch-style variants, but 'checkout' is a recognizable git verb.

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?

"Checkout only if no protected paths or submodules change" gives an implied when-not condition, and the repo_path sentence gives usage guidance. However, no alternative tool is named (e.g. when to use git_branch or git_restore instead), so the routing guidance is only implied.

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