Skip to main content
Glama

List repository branches

list_repository_branches
Read-only

List the branches of a GitHub repository accessible to an installation: pass the numeric installationId from list_github_installations, owner and repo. Lists at most the first 1,000 branches in alphabetical order, plus the default branch (flagged) when it sorts later. For a GitLab repository pass connectionId (list_gitlab_connections) and repositoryId (list_gitlab_repositories) instead: every branch, the default flagged.

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": "list_repository_branches"
  }
}

Input Schema

NameRequiredDescriptionDefault
repoNoRequired for a GitHub repository.
ownerNoRequired for a GitHub repository.
connectionIdNoA GitLab connection of the organisation. Required for a GitLab repository.
repositoryIdNoGitLab’s numeric project id. Required for a GitLab repository.
installationIdNoGitHub App installation id. Required for a GitHub repository.

Output Schema

NameRequiredDescriptionDefault
branchesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / properties / connectionId
      Added value: +{
      +  "description": "A GitLab connection of the organisation. Required for a GitLab repository.",
      +  "format": "uuid",
      +  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +  "type": "string"
      +}
    • changedInput schema / properties / installationId / description
      Previous value: -"GitHub App installation id"New value: +"GitHub App installation id. Required for a GitHub repository."
    • addedInput schema / properties / owner / description
      Added value: +"Required for a GitHub repository."
    • addedInput schema / properties / repo / description
      Added value: +"Required for a GitHub repository."
    • addedInput schema / properties / repositoryId
      Added value: +{
      +  "description": "GitLab’s numeric project id. Required for a GitLab repository.",
      +  "exclusiveMinimum": 0,
      +  "maximum": 9007199254740991,
      +  "type": "integer"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "installationId",
      -  "owner",
      -  "repo"
      -]
  2. Changed2 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already establish readOnly/openWorld/non-destructive, and the description adds substantially more: a hard 1,000-branch limit, alphabetical ordering, and the non-obvious detail that the default branch is included and flagged even when it would sort past the cap. It also notes the limit does not apply to GitLab ('every branch'), which prevents a false assumption of symmetric behavior.

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?

Two sentences, front-loaded with the primary GitHub case and the result-size caveat, with the GitLab variant following. It is dense but every clause carries information; the colon-chained parentheticals in the second sentence make it slightly harder to scan than it needs to be.

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

Completeness5/5

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

The schema marks zero required parameters, so conditional requiredness is invisible to the agent; the description is the only place that resolves which fields matter for which provider, and it does so completely. With an output schema present, no return-shape explanation is needed, and the ordering/limit behavior covers the remaining risk.

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%, so the baseline is 3, but the description adds meaning the schema cannot: the conditional GitHub-vs-GitLab parameter pairing, and the provenance of each id (installationId from list_github_installations, connectionId from list_gitlab_connections, repositoryId from list_gitlab_repositories). That materially reduces misuse of the untyped, all-optional parameter set.

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 opens with a specific verb+resource ('List the branches of a GitHub repository') and immediately scopes it to what is accessible to an installation, then extends the same operation to GitLab. No sibling tool lists branches, so there is no ambiguity to resolve, and the dual-provider shape of the tool is made explicit up front.

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?

It gives concrete invocation guidance per provider: pass installationId/owner/repo for GitHub, or connectionId/repositoryId for GitLab. It also cross-references the sibling tools (list_github_installations, list_gitlab_connections, list_gitlab_repositories) that supply those identifiers, which is the main practical obstacle to calling this tool. It stops short of stating when not to use it or how to handle truncation beyond the 1,000 cap, so a 4 rather than 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.