Skip to main content
Glama

gitCheckout

Destructive

Switch to an existing branch or create a new branch from HEAD or a specified base. Branch creation is optional with a configurable base.

Instructions

Switch to a branch, or create and switch to a new branch. Use create: true to create from HEAD or a specified base.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchYesBranch name to switch to or create
createNoCreate branch if it doesn't exist. Default: false.
baseNoBase branch or commit to create from (only when create: true). Defaults to HEAD.
Behavior2/5

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

Annotations already declare destructiveHint: true. The description adds no behavioral details beyond what the annotation provides, such as effects on uncommitted changes or workspace state. It does not contradict annotations, but the burden of disclosure is minimally addressed.

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 comprises two concise sentences with no extraneous information. It front-loads the core purpose and immediately adds parameter guidance, making it efficient for an agent to parse.

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

Completeness4/5

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

Given no output schema and a simple tool, the description covers the primary use case. It mentions branch switching and creation with optional base. However, it omits details about failure scenarios (e.g., dirty working tree) and return behavior, which would be helpful but are not critical for a basic checkout operation.

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%, and the description adds value by explaining the interplay between 'create' and 'base' ('use create: true to create from HEAD or a specified base'), which is not fully captured in the schema's individual descriptions. This clarifies the conditional usage.

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 action ('switch to' or 'create and switch to') and the resource ('a branch'). It distinguishes from sibling tools by focusing on branch switching/creation, while siblings like gitAdd or gitCommit handle different operations.

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?

The description provides usage guidance for the 'create' parameter ('use create: true to create from HEAD or a specified base'), but lacks explicit when-to-use or when-not-to-use instructions relative to sibling tools like gitListBranches or gitStash. Usage is implied but not explicitly contrasted.

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/Oolab-labs/patchwork-os'

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