Skip to main content
Glama
GeminiDesk MCP
by LZ7TOP

Git Branch Operations

git_branch

List, create, switch, or delete Git branches in a local repository to manage parallel development workflows.

Instructions

列出、创建、切换或删除 Git 分支。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "git_branch"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNo分支名称(create/checkout/delete 时必填)
actionNo分支操作类型list
repoPathNoGit 仓库路径

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

C2.9/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 disclosure burden, yet it says nothing about the destructive nature of delete (safe -d vs force -D), what happens to uncommitted work on checkout, or whether create fails on an existing branch name. Enumerating 'delete' does signal a mutation, but without any safety or failure-mode detail this is a significant gap for a multi-mode mutation tool.

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?

A single front-loaded sentence with zero filler, and the operation list is presented before any other detail. It is arguably over-compressed for a four-mode tool, but nothing is wasted.

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?

This is a four-mode tool with no annotations and no output schema, so the description should at least sketch per-action expectations (what list returns, what happens on delete). It instead gives only the bare operation list, leaving the agent to guess at return shapes and failure behavior.

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 name, action, and repoPath are already documented in the schema, including the note that name is required for create/checkout/delete. The description adds nothing beyond restating the action set, so the baseline 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 names a specific resource (Git branches) and enumerates the concrete operations — list, create, checkout, delete — which map exactly to the action enum. This clearly separates it from siblings like git_commit, git_diff, or git_log, though it does not explicitly point at those alternatives.

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?

There is no when-to-use guidance, no prerequisites (e.g. that a Git repository must exist at repoPath), and no routing advice versus sibling Git tools. The agent must infer that branch management belongs here rather than in git_sync or git_status.

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