Skip to main content
Glama

Discover Project

gitlab_discover_project
Read-onlyIdempotent

Resolve a git remote URL to get GitLab project ID and metadata. Start workspace sessions by providing the project_id required by other GitLab tools. Extract the full URL from git remote -v, pass it as-is.

Instructions

Resolve a git remote URL to a GitLab project and return its project_id and metadata. Read-only; performs a lookup against the GitLab Projects API; no side effects.

When to use: at the start of a workspace session, to obtain the project_id required by most other gitlab_* tools. Extract the FULL remote URL from .git/config ([remote "origin"] url = ...) or from 'git remote -v'. NOT for: searching projects by name (use gitlab_search action=projects), listing a user's projects (use gitlab_project action=list_user_projects), verifying GitLab connectivity or authentication (use gitlab_server action=health_check).

IMPORTANT: pass the complete URL exactly as it appears — do NOT strip the git@ prefix from SSH URLs. Supported formats (a URL scheme or git@ user prefix is required):

  • HTTPS: https://gitlab.example.com/group/project.git

  • SSH shorthand: git@gitlab.example.com:group/project.git

  • SSH protocol: ssh://git@gitlab.example.com/group/project.git

Returns: {id, name, path, path_with_namespace, web_url, description, default_branch, visibility, http_url_to_repo, ssh_url_to_repo, extracted_path}. Errors: 404 not found (hint: project may be private — verify token permissions), 403 forbidden (hint: token lacks read_api scope).

See also: gitlab_project (full project CRUD/settings once id is known), gitlab_server (connectivity and version checks), gitlab_search (find projects by query).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
remote_urlYesFull git remote URL (HTTPS or SSH) exactly as shown in .git/config or 'git remote -v' output. IMPORTANT: pass the complete URL including the scheme (https://) or user prefix (git@). Examples: 'https://gitlab.example.com/group/project.git' or 'git@gitlab.example.com:group/project.git'. Do NOT strip the git@ prefix from SSH URLs.,required

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
next_stepsNo
idYes
nameYes
pathYes
path_with_namespaceYes
web_urlYes
default_branchYes
descriptionYes
visibilityYes
http_url_to_repoNo
ssh_url_to_repoNo
extracted_pathYes
Behavior5/5

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

Beyond annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint), the description adds that it performs an API lookup with no side effects, and details error responses (404, 403) with hints about token permissions and private projects.

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?

Well-structured with clear sections, bullet examples, and a prominent note. Slightly longer than necessary but efficient and easy to parse.

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?

Given one parameter, full schema coverage, annotations, and output schema, the description is complete—it covers purpose, usage, inputs, outputs, errors, and alternatives without gaps.

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% with a clear description for remote_url. The description adds supplementary info about supported URL formats and the requirement to pass the complete URL without stripping prefixes, exceeding the schema baseline.

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 clearly states the tool resolves a remote URL to a GitLab project and returns project_id and metadata. It uses specific verbs and distinguishes from siblings like gitlab_search and gitlab_project.

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?

Explicitly states when to use (start of workspace), what not to use for (search, list, health check), and provides alternatives. Also gives specific instructions on extracting the URL from .git/config or git remote -v.

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/jmrplens/gitlab-mcp-server'

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