Parse a GitLab web URL
parse_gitlab_urlTurn 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
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The GitLab web link, e.g. 'https://gitlab.example.com/group/repo/-/blob/fix/PROJ-7608/src/index.tsx#L12-20'. | |
| resolve | No | Match 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. |