Skip to main content
Glama

list_groups

Retrieve a paginated list of GitLab groups. Specify the number of groups per page and an optional access token for authentication.

Instructions

List GitLab groups.

Args:
    per_page: Number of groups per page (max 100)
    token: GitLab Personal Access Token (optional)
    ctx: MCP context (automatically injected)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
per_pageNo
tokenNo
ctxNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The list_groups tool handler function. It calls GitLab API /groups endpoint, paginates with per_page (max 100), and returns a formatted list of group names, paths, and IDs.
    async def list_groups(per_page: int = 20, token: str = None, ctx=None) -> str:
        """List GitLab groups.
        
        Args:
            per_page: Number of groups per page (max 100)
            token: GitLab Personal Access Token (optional)
            ctx: MCP context (automatically injected)
        """
        per_page = min(per_page, 100)
        data = await make_gitlab_request(f"/groups?per_page={per_page}", ctx=ctx, token=token)
        if isinstance(data, dict) and "error" in data:
            return f"Error: {data['error']}"
        if not data:
            return "No groups found."
        
        groups = []
        for group in data:
            groups.append(f"• {group['name']} ({group['path']}) - ID: {group['id']}")
        return "\n".join(groups)
  • The tool is registered via the @mcp.tool() decorator on the list_groups function at line 246.
    async def list_groups(per_page: int = 20, token: str = None, ctx=None) -> str:
        """List GitLab groups.
        
        Args:
            per_page: Number of groups per page (max 100)
            token: GitLab Personal Access Token (optional)
            ctx: MCP context (automatically injected)
        """
        per_page = min(per_page, 100)
        data = await make_gitlab_request(f"/groups?per_page={per_page}", ctx=ctx, token=token)
        if isinstance(data, dict) and "error" in data:
            return f"Error: {data['error']}"
        if not data:
            return "No groups found."
        
        groups = []
        for group in data:
            groups.append(f"• {group['name']} ({group['path']}) - ID: {group['id']}")
        return "\n".join(groups)
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 any behavioral traits such as authentication requirements, rate limits, or whether the operation is read-only. The description is limited to parameter descriptions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with one line of purpose followed by a structured Args list. No redundant information.

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?

While simple, the description does not specify the scope of groups listed (e.g., all accessible, user's groups). With an output schema present, explanation of return values is not required but the functional scope remains ambiguous.

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 description coverage is 0%, so the description adds significant value by explaining parameters: per_page (max 100), token (optional PAT), and ctx (injected). This compensates for the lack of schema descriptions.

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 'List GitLab groups,' specifying the verb and resource. It distinguishes itself from siblings like 'list_group_projects' by focusing on groups themselves.

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 on when to use this tool versus alternatives. Does not explain prerequisites, context, or exclusions.

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