Skip to main content
Glama
Gerrit OpenAPI MCP

Gerrit OpenAPI MCP

by davido

Getprojectsprojectidbranchesbranchid

getProjectsProjectIdBranchesBranchId

Retrieve a project branch by project and branch ID, including automatic resolution of refs/users/self to the calling user's branch in the All-Users repository.

Instructions

Retrieves a branch of a project. For the "All-Users" repository, the magic branch "refs/users/self" is automatically resolved to the user branch of the calling user.

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": {
      "project-id": "<project-id>",
      "branch-id": "<branch-id>"
    },
    "name": "getProjectsProjectIdBranchesBranchId"
  }
}

Input Schema

NameRequiredDescriptionDefault
branch-idYes
project-idYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/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. It does add one genuine behavioral fact, the automatic resolution of "refs/users/self" for the All-Users repository, but says nothing about required permissions, visibility of private projects/branches, or error behavior for a non-existent branch.

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 core action, no filler. The second sentence is niche but earns its place as non-obvious edge-case behavior.

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

Completeness3/5

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

An output schema exists so return values need not be described, and the tool is a simple two-parameter read. Still, for a mutation-free retrieval with no annotations, the definition leaves access requirements and identifier formats unaddressed.

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 description coverage is 0%, so the description must compensate, and it partially does by implying that branch-id accepts ref-style values such as "refs/users/self", not just plain branch names. It still never explains whether project-id is a numeric ID or a URL-encoded namespace/path, which is a meaningful ambiguity for this API.

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?

States a specific verb and resource: "Retrieves a branch of a project." That distinguishes it from the list endpoint getProjectsProjectIdBranches, but it never clarifies its boundary against the many sibling branch sub-resources (files, reflog, mergeable), so an agent must infer it returns branch metadata only.

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

Usage Guidelines3/5

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

Usage is only implied by the retrieval phrasing; there is no explicit statement of when to call this versus the branch list or the sibling branch endpoints. The one concrete guidance note is for the narrow "All-Users" repository case, where the magic ref "refs/users/self" is resolved automatically, which is useful but situational.

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

Deploy Server

Other Tools