Skip to main content
Glama

get_project_labels

Retrieve all labels from a specified GitLab project using its project ID. Optionally authenticate with a personal access token.

Instructions

Get project labels.

Args:
    project_id: GitLab project ID
    token: GitLab Personal Access Token (optional)
    ctx: MCP context (automatically injected)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
tokenNo
ctxNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'get_project_labels' async function is the MCP tool handler that fetches project labels from the GitLab API. It is registered as an MCP tool via the @mcp.tool() decorator on line 620. It takes a project_id parameter, calls the GitLab API endpoint /projects/{project_id}/labels, and formats the labels as a bulleted list showing each label's name and color.
    # Labels
    @mcp.tool()
    async def get_project_labels(project_id: int, token: str = None, ctx=None) -> str:
        """Get project labels.
        
        Args:
            project_id: GitLab project ID
            token: GitLab Personal Access Token (optional)
            ctx: MCP context (automatically injected)
        """
        data = await make_gitlab_request(f"/projects/{project_id}/labels", ctx=ctx, token=token)
        if isinstance(data, dict) and "error" in data:
            return f"Error: {data['error']}"
        if not data:
            return "No labels found."
        
        labels = []
        for label in data:
            labels.append(f"• {label['name']} ({label['color']})")
        return "\n".join(labels)
  • The tool is registered as an MCP tool using the @mcp.tool() decorator on line 620, which is the FastMCP instance defined on line 9.
    # Labels
    @mcp.tool()
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral traits such as whether it returns a list, pagination behavior, or rate limits. It only states 'Get project labels' with no further detail.

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?

The description is concise and front-loaded with the main purpose. The parameter list is redundant with the schema but does not waste many words. A streamlined description without the parameter list could be more concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple nature of the tool and the presence of an output schema, the description is adequate but lacks mention that it returns all labels for a project. It does not explain the structure of labels or provide usage hints.

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?

The description adds minimal meaning beyond the schema by specifying that the token is optional and ctx is auto-injected. However, schema description coverage is 0%, so the description partially compensates but lacks comprehensive parameter details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Get project labels.' which clearly identifies the action and resource. While there is no differentiation from siblings, no sibling tool with a similar name exists, so the purpose is clear.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. There is no mention of prerequisites, context, or when not to use it.

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

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