Skip to main content
Glama
martinsky999

MCP Git Server

by martinsky999

git_checkout

Switch between branches in a Git repository to access different code versions or development lines.

Instructions

Switches branches

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYes
branch_nameYes

Implementation Reference

  • The main handler function that performs the git checkout operation on the given repository and branch.
    def git_checkout(repo: git.Repo, branch_name: str) -> str:
        repo.git.checkout(branch_name)
        return f"Switched to branch '{branch_name}'"
  • Pydantic model defining the input schema for the git_checkout tool, including repo_path and branch_name.
    class GitCheckout(BaseModel):
        repo_path: str
        branch_name: str
  • Registration of the git_checkout tool in the list_tools handler, using the name from GitTools.CHECKOUT and GitCheckout schema.
    Tool(
        name=GitTools.CHECKOUT,
        description="Switches branches",
        inputSchema=GitCheckout.schema(),
    ),
  • Enum value in GitTools defining the tool name 'git_checkout'.
    CHECKOUT = "git_checkout"
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. 'Switches branches' implies a mutation operation that changes the active branch, but it doesn't disclose key behaviors: whether it requires the branch to exist, if it updates the working directory, potential for data loss if uncommitted changes exist, or error conditions. This is inadequate for a mutation tool with zero annotation coverage.

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 extremely concise with just two words, front-loaded and zero waste. It directly states the action without unnecessary elaboration, making it efficient for quick understanding, though this brevity contributes to gaps in other dimensions.

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?

Given the tool's complexity (mutation operation with 2 parameters), no annotations, no output schema, and 0% schema coverage, the description is incomplete. It lacks details on behavior, parameters, error handling, and output, making it insufficient for safe and effective use by an AI agent in a Git workflow context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It adds no meaning beyond the schema: parameters 'repo_path' and 'branch_name' are not explained, their formats or purposes (e.g., path to Git repository, name of target branch) are unspecified, and the description doesn't clarify how they relate to the action. This fails to compensate for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Switches branches' states a clear verb ('Switches') and resource ('branches'), but it's vague about what this means in Git context. It doesn't specify that this changes the working directory to a different branch or mention the repository context, and it doesn't distinguish from sibling tools like git_create_branch or git_reset which also involve branch operations.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing branch), exclusions (e.g., not for creating new branches), or refer to sibling tools like git_create_branch for branch creation or git_reset for undoing changes, leaving usage context unclear.

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/martinsky999/mcp-git-py'

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