Skip to main content
Glama

Get exact Git reference

gh_get_ref
Read-onlyIdempotent

Get a single Git ref (branch or tag) from a GitHub repository.

Instructions

Read-only: resolve one exact branch or tag reference path such as heads/main or tags/v1.0.0. This tool never performs matching-reference or prefix discovery. Annotated tag objects retain their tag-object identity and are peeled through bounded exact tag-object reads to a commit when applicable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refYesOne exact Git ref path relative to refs/, formatted as heads/<branch> or tags/<tag>. Do not pass refs/, a bare branch/tag name, or a matching prefix.
repoYesGitHub repository name without the owner prefix.
ownerYesGitHub repository owner or organization login.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
refYes
foundYes
object_shaNo
object_urlNo
object_typeNo
peeled_commit_shaNo
Behavior4/5

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

Annotations already classify the tool as read-only, idempotent, open-world, and non-destructive; the description adds meaningful behavioral detail beyond those hints by constraining the operation to exact references and explaining annotated tag handling ('peeled through bounded exact tag-object reads'). No contradiction with annotations is present.

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?

The description is three sentences, starts with 'Read-only:', and front-loads the core behavior and concrete examples. The annotated-tag sentence is technical but earns its place by disclosing non-obvious behavior; there is no filler or redundancy.

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 the rich parameter documentation and existing output schema, the description provides sufficient context for exact reference resolution: what qualifies, what is excluded, and how annotated tags are handled. It could name a direct alternative for non-exact discovery, but the explicit exclusions already cover the main decision boundary.

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?

With 100% schema description coverage, the schema already documents owner, repo, and ref, including the ref pattern and anti-patterns such as refs/, bare names, and matching prefixes. The top-level description reinforces valid forms but does not meaningfully deepen parameter semantics beyond what the schema already provides, so the baseline 3 applies.

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?

Description uses a specific verb ('resolve') and identifies the resource ('exact branch or tag reference path') with concrete examples. It explicitly rules out matching-reference or prefix discovery, distinguishing this exact lookup from any fuzzy sibling. The title alone is somewhat generic, but the description is not.

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 clearly states the tool is for one exact branch or tag reference and explicitly negates alternative behavior ('never performs matching-reference or prefix discovery'), making it evident that fuzzy or prefixed lookups belong elsewhere. It does not name a specific sibling tool for non-exact discovery, so it stops short of fully explicit alternative selection.

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/fvanevski/gh_mcp'

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