Skip to main content
Glama

github_mcp.list_branches

Read-only

Lists local and remote branches with commit SHAs for an allowlisted repository so you can identify a base branch before creating or comparing work.

Instructions

List up to 200 local and remote refs with commit SHAs for an allowlisted repository. Refreshes the local read cache from the source; does not publish changes. Use to identify a base branch.

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": {
      "repository": "<repository>"
    },
    "name": "github_mcp.list_branches"
  }
}

Input Schema

NameRequiredDescriptionDefault
repositoryYesAllowlisted owner/repo identifier.

Output Schema

NameRequiredDescriptionDefault
okYes
dataNo
messageNo
error_codeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.0.2
    • addedInput schema / properties / repository / description
      Added value: +"Allowlisted owner/repo identifier."
  2. First observedv1.0.1

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/openWorldHint/destructiveHint, but the description adds real value beyond them: the 200-ref cap, that both local and remote refs are returned with SHAs, and the notable side effect that it 'refreshes the local read cache from the source.' That cache-refresh disclosure is precisely the kind of behavior annotations would hide. It stops short of covering auth/allowlist failure behavior or whether the 200 cap implies truncation.

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?

Three tight sentences: capability and cap first, side-effect clarity second, usage cue last. No filler, and the truncation limit is front-loaded where an agent will see it.

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?

With one required parameter and an output schema, return-value explanation isn't needed, and the description covers scope, size limit, and side effects. The remaining gap is what happens for a non-allowlisted repo or whether the 200 cap means results are silently truncated.

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?

There is a single parameter with 100% schema description coverage ('Allowlisted owner/repo identifier'), so the schema already carries the meaning. The description's mention of an 'allowlisted repository' merely echoes that constraint without adding format, validation, or edge-case detail, so 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?

Specific verb 'List' plus the resource ('up to 200 local and remote refs with commit SHAs') and a scope qualifier (allowlisted repository). It reads distinctly from list_recent_commits or list_tree, though it never names a sibling to contrast against, which keeps it short of a 5.

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?

'Use to identify a base branch' gives a concrete selection context, so an agent knows when to reach for this tool. There are no explicit exclusions or named alternatives, so it lands at clear-context-without-exclusions rather than full routing guidance.

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