Skip to main content
Glama
igordev96
by igordev96

Parse a GitLab web URL

parse_gitlab_url
Read-only

Turn a GitLab web link into project, ref, path, and line range for read operations, resolving slash-containing refs and rejecting unsupported merge request links.

Instructions

Turn a GitLab web link into the project, ref, path and line range a read needs — including a ref that contains slashes, which is resolved against the project's own refs. Accepts /-/blob/, /-/raw/, /-/tree/ and /-/blame/ links, which name a file or a directory, and /-/commit/ and /-/commits/[/], which name a commit and a history; merge request and other links are refused by name rather than guessed at. The link's host must be GITLAB_HOST. Resolving may mirror the project on first use; set resolve: false to parse offline without touching it. get_file, list_tree, log, get_commit and blame accept a url directly, so this tool is for inspecting a link, not for reading.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe GitLab web link, e.g. 'https://gitlab.example.com/group/repo/-/blob/fix/PROJ-7608/src/index.tsx#L12-20'.
resolveNoMatch the link's ref against the project's refs and resolve it to a commit (default true). Set false to split the ref at the first segment without touching the project.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.10.1

TDQS

A4.4/5.0
Behavior3/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 structurally. The description nonetheless adds real behavioral context: the host must be GITLAB_HOST, resolving may mirror the project on first use, and `resolve: false` avoids touching it. It does not describe the shape of the returned object (project/ref/path/line range are only implied), so it adds value but stops short of full behavioral disclosure.

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?

Front-loaded with the core transformation in the first clause, and every sentence carries non-redundant information (link types, refusals, host constraint, mirroring, plus the sibling hand-off). Sentences are long and clause-heavy, which costs some scannability but not correctness.

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?

No output schema exists, and the description compensates by naming what is extracted (project, ref, path, line range) and what happens on rejection. With the host/mirroring constraints and offline option covered, an agent has enough to call it correctly.

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; the description adds meaning beyond the schema by explaining that refs containing slashes are resolved against the project's own refs, which clarifies the hard case the two schema lines only gesture at. It does not add syntax detail for the base url parameter, so it falls short of 5.

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?

States a specific verb and resource ('Turn a GitLab web link into the project, ref, path and line range') and enumerates exactly which URL shapes it handles. It distinguishes itself from siblings by naming get_file, list_tree, log, get_commit and blame and clarifying they accept a url directly, so an agent can route without opening schemas.

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

Usage Guidelines5/5

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

Gives explicit when-to-use ('for inspecting a link, not for reading') and when-not-to-use, plus an inbound filter: which GitLab link types are accepted versus refused ('merge request and other links are refused by name rather than guessed at'). It also states the host precondition and the offline escape hatch.

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