Skip to main content
Glama
igordev96
by igordev96

Resolve a ref to a commit

resolve_ref
Read-only

Resolve a branch, tag, or revision to its full commit SHA and identify it as branch, tag, or commit. Use it to confirm a ref exists before reading files from it.

Instructions

Resolve a branch, tag, or revision to the full commit SHA it points at, and say what it is (branch, tag, or commit for anything else). Use this to confirm a ref exists before reading files from it. If the ref is missing, the error lists similar names, and it says so when the copy could not be refreshed, since then a missing ref proves nothing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refYesBranch, tag, or commit SHA, e.g. 'develop' or 'fix/PROJ-7608'.
projectNoGitLab project path, e.g. 'group/subgroup/repo'. Defaults to GITLAB_DEFAULT_PROJECT.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.10.1

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered. The description adds genuinely non-derivable behavior: missing refs produce an error that 'lists similar names,' and a stale working copy is flagged so that 'a missing ref proves nothing.' That stale-data caveat is exactly the kind of context that prevents a wrong conclusion, though nothing is said about auth or rate limits.

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 what the tool returns before the usage advice, and every clause carries information. The final sentence is somewhat dense ('and it says so when the copy could not be refreshed') but still earns its place by qualifying the error semantics.

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?

For a two-parameter read tool with no output schema, the description covers purpose, when to call it, the shape of the return value, and error behavior. With annotations handling the safety profile and the schema handling parameter docs, it is close to complete; only the absence of any mention of alternative ref-listing tools is a minor gap.

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%, with the ref format and an example ('develop', 'fix/PROJ-7608') and the project path fallback to GITLAB_DEFAULT_PROJECT already documented in the schema. The description adds no syntax, format, or default information beyond that, 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?

The description names a specific verb ('resolve'), the resource ('a branch, tag, or revision'), and the exact output ('the full commit SHA it points at', plus a type label of branch/tag/commit). That scope clearly separates it from siblings like list_refs (enumerate) or get_commit (fetch metadata), so an agent can route correctly without opening the schema.

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 an explicit use case: 'Use this to confirm a ref exists before reading files from it,' which tells the agent when this is the right call. It does not name an alternative or say when not to use it (e.g. vs. list_refs), so it stops short of full routing guidance.

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