Skip to main content
Glama

gitlab_list_groups

List accessible GitLab groups to browse group hierarchy, find group IDs, and filter by ownership or search terms.

Instructions

List accessible GitLab groups Returns: Array of groups with ID, name, path, description Use when: Browsing groups, finding group IDs, navigating group hierarchy Pagination: Yes (default 50 per page) Filtering: By ownership, name search

Example response: [{ "id": 123, "name": "My Group", "path": "my-group", "full_path": "parent-group/my-group", "description": "Group for team projects", "web_url": "https://gitlab.com/groups/my-group", "visibility": "private" }]

Related tools:

  • gitlab_get_group: Get full group details

  • gitlab_list_group_projects: List projects in a group

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchNoSearch query Type: string Matching: Case-insensitive, partial matching Searches in: Project names and descriptions Examples: - 'frontend' (finds 'frontend-app', 'old-frontend', etc.) - 'API' (matches 'api', 'API', 'GraphQL-API', etc.) Tip: Use specific terms for better results for groups
ownedNoFilter for owned groups only Type: boolean Default: false Options: - true: Only groups where you are the owner - false: All accessible groups Use case: Managing your own groups
per_pageNoNumber of results per page Type: integer Range: 1-100 Default: 20 Example: 50 (for faster browsing) Tip: Use smaller values (10-20) for detailed operations, larger (50-100) for listing
pageNoPage number for pagination Type: integer Range: ≥1 Default: 1 Example: 3 (to get the third page of results) Note: Use with per_page to navigate large result sets

Implementation Reference

  • The primary handler function that implements the core logic for the 'gitlab_list_groups' tool. It parses input arguments and calls the underlying GitLabClient.list_groups method to fetch groups.
    def handle_list_groups(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> Dict[str, Any]:
        """Handle listing groups"""
        search = get_argument(arguments, "search")
        owned = get_argument(arguments, "owned", False)
        per_page = get_argument(arguments, "per_page", DEFAULT_PAGE_SIZE)
        page = get_argument(arguments, "page", 1)
        
        return client.list_groups(search=search, owned=owned, per_page=per_page, page=page)
  • The input schema definition for the 'gitlab_list_groups' tool, specifying parameters like search, owned, per_page, and page.
        name=TOOL_LIST_GROUPS,
        description=desc.DESC_LIST_GROUPS,
        inputSchema={
            "type": "object",
            "properties": {
                "search": {"type": "string", "description": desc.DESC_SEARCH_TERM + " for groups"},
                "owned": {"type": "boolean", "description": desc.DESC_OWNED_GROUPS, "default": False},
                "per_page": {"type": "integer", "description": desc.DESC_PER_PAGE, "default": DEFAULT_PAGE_SIZE, "minimum": 1, "maximum": MAX_PAGE_SIZE},
                "page": {"type": "integer", "description": desc.DESC_PAGE_NUMBER, "default": 1, "minimum": 1}
            }
        }
    ),
  • Registration of the handler function in the TOOL_HANDLERS dictionary, which maps tool names to their handler functions. Used by server.py to dispatch calls.
    TOOL_LIST_GROUPS: handle_list_groups,
    TOOL_LIST_GROUP_PROJECTS: handle_list_group_projects,
  • Tool registration and schema in the server's list_tools handler, exposing the tool to MCP clients.
        name=TOOL_LIST_GROUPS,
        description=desc.DESC_LIST_GROUPS,
        inputSchema={
            "type": "object",
            "properties": {
                "search": {"type": "string", "description": desc.DESC_SEARCH_TERM + " for groups"},
                "owned": {"type": "boolean", "description": desc.DESC_OWNED_GROUPS, "default": False},
                "per_page": {"type": "integer", "description": desc.DESC_PER_PAGE, "default": DEFAULT_PAGE_SIZE, "minimum": 1, "maximum": MAX_PAGE_SIZE},
                "page": {"type": "integer", "description": desc.DESC_PAGE_NUMBER, "default": 1, "minimum": 1}
            }
        }
    ),
  • Constant definition for the tool name 'gitlab_list_groups', used across modules for consistency.
    TOOL_LIST_GROUPS = "gitlab_list_groups"
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing pagination behavior ('Yes (default 50 per page)'), filtering capabilities ('By ownership, name search'), and example response structure. It doesn't mention authentication requirements or rate limits, but covers key operational behaviors.

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 efficiently structured with clear sections (Returns, Use when, Pagination, Filtering, Example response, Related tools), each providing essential information without redundancy. Every sentence serves a distinct purpose.

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

Completeness4/5

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

For a read-only listing tool with 4 parameters and no output schema, the description provides comprehensive context including return format, usage scenarios, pagination details, filtering options, example response, and sibling tool relationships. The main gap is the lack of output schema, but the example response compensates reasonably.

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?

Schema description coverage is 100%, so the schema already fully documents all 4 parameters. The description mentions filtering by ownership and name search, which aligns with the 'owned' and 'search' parameters, but doesn't add meaningful semantic value beyond what's in the 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 the verb ('List') and resource ('accessible GitLab groups'), and distinguishes it from siblings by specifying it returns an array of groups with specific fields. It explicitly differentiates from gitlab_get_group (full details) and gitlab_list_group_projects (projects within groups).

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?

The description includes a dedicated 'Use when' section with explicit scenarios (browsing groups, finding group IDs, navigating hierarchy) and lists related tools with their specific purposes, providing clear guidance on when to use this tool versus alternatives.

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/Vijay-Duke/mcp-gitlab'

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