Skip to main content
Glama
archish9

GitHub MCP Server

by archish9

switch_branch

Change the active branch in a Git repository to work on different code versions. This tool updates the working directory to match the state of the specified branch using git checkout.

Instructions

Switch the repository to a different branch.

This command updates the working directory to match the state of the specified branch. It performs a git checkout.

Args: repo_path: The absolute path to the repository. branch_name: The name of the branch to switch to. The branch must already exist.

Returns: A confirmation message indicating the successful switch and current branch name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYes
branch_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool updates the working directory and performs a 'git checkout', which implies mutation behavior. However, it doesn't mention potential side effects (e.g., uncommitted changes might be lost), permission requirements, or error conditions beyond the branch existence check.

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?

The description is well-structured with clear sections (purpose, behavior, args, returns) and front-loaded the core purpose. It's appropriately sized, though the 'git checkout' mention could be considered slightly redundant with the main description. Every sentence adds value.

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 2 parameters with 0% schema coverage and no annotations, the description does a good job explaining parameters and basic behavior. The presence of an output schema means the description doesn't need to detail return values. However, for a mutation tool with no annotations, it could better address potential risks or side effects.

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

Parameters5/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 fully. It successfully adds meaning beyond the bare schema by explaining both parameters: 'repo_path' as 'The absolute path to the repository' and 'branch_name' with the constraint 'The branch must already exist'. This provides crucial semantic context not in 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 specific action ('Switch the repository to a different branch') and the resource ('repository'), distinguishing it from siblings like 'create_branch' (which creates new branches) and 'list_branches' (which only lists them). The mention of 'git checkout' provides technical specificity.

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 provides clear context for when to use this tool ('to switch to a different branch') and includes a prerequisite ('The branch must already exist'), which helps differentiate from 'create_branch'. However, it doesn't explicitly state when NOT to use it or mention alternatives like 'rollback_to_commit' for different scenarios.

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/archish9/VersionControlHelperMCP'

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