Skip to main content
Glama

list_group_projects

Retrieve and filter all projects within a GitLab group, including options for subgroups, sorting, visibility, and pagination. Streamline repository management with precise search and ordering capabilities.

Instructions

List all projects (repositories) within a specific GitLab group

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
archivedNo
group_idNo
include_subgroupsNo
order_byNo
pageNo
per_pageNo
searchNo
simpleNo
sortNo
visibilityNo

Implementation Reference

  • Core handler function in GitLabApi class that lists projects in a group by calling GitLab API /groups/{groupId}/projects, applies options as query params, parses response using GitLabGroupProjectsResponseSchema.
    async listGroupProjects(
      groupId: string,
      options: {
        archived?: boolean;
        visibility?: 'public' | 'internal' | 'private';
        order_by?: 'id' | 'name' | 'path' | 'created_at' | 'updated_at' | 'last_activity_at';
        sort?: 'asc' | 'desc';
        search?: string;
        simple?: boolean;
        include_subgroups?: boolean;
        page?: number;
        per_page?: number;
      } = {}
    ): Promise<GitLabGroupProjectsResponse> {
      const url = new URL(`${this.apiUrl}/groups/${encodeURIComponent(groupId)}/projects`);
    
      // Add query parameters
      Object.entries(options).forEach(([key, value]) => {
        if (value !== undefined) {
          url.searchParams.append(key, value.toString());
        }
      });
    
      const response = await fetch(url.toString(), {
        headers: {
          "Authorization": `Bearer ${this.token}`
        }
      });
    
      if (!response.ok) {
        throw new McpError(
          ErrorCode.InternalError,
          `GitLab API error: ${response.statusText}`
        );
      }
    
      const projects = await response.json();
      const totalCount = parseInt(response.headers.get("X-Total") || "0");
    
      return GitLabGroupProjectsResponseSchema.parse({
        count: totalCount,
        items: projects
      });
    }
  • Zod input schema defining parameters for list_group_projects tool: group_id (required), and optional filters like archived, visibility, order_by, etc.
    export const ListGroupProjectsSchema = z.object({
      group_id: z.string(),
      archived: z.boolean().optional(),
      visibility: z.enum(['public', 'internal', 'private']).optional(),
      order_by: z.enum(['id', 'name', 'path', 'created_at', 'updated_at', 'last_activity_at']).optional(),
      sort: z.enum(['asc', 'desc']).optional(),
      search: z.string().optional(),
      simple: z.boolean().optional(),
      include_subgroups: z.boolean().optional(),
      page: z.number().optional(),
      per_page: z.number().optional()
    });
  • src/index.ts:162-167 (registration)
    Tool registration in ALL_TOOLS array, defining name, description, inputSchema from ListGroupProjectsSchema, marked as readOnly.
    {
      name: "list_group_projects",
      description: "List all projects (repositories) within a specific GitLab group",
      inputSchema: createJsonSchema(ListGroupProjectsSchema),
      readOnly: true
    },
  • MCP server tool dispatch handler: parses input with ListGroupProjectsSchema, destructures args, calls gitlabApi.listGroupProjects, returns JSON stringified results.
    case "list_group_projects": {
      const args = ListGroupProjectsSchema.parse(request.params.arguments);
      const { group_id, ...options } = args;
      const results = await gitlabApi.listGroupProjects(group_id, options);
      return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }] };
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it's a list operation, implying read-only behavior, but doesn't cover critical aspects like pagination handling (implied by 'page' and 'per_page' parameters), rate limits, authentication requirements, or what the output format looks like. This is inadequate for a tool with 10 parameters.

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 a single, efficient sentence that front-loads the core purpose without unnecessary words. Every part of it contributes directly to understanding what the tool does, making it highly concise and well-structured.

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

Completeness2/5

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

Given the complexity (10 parameters, no annotations, no output schema), the description is incomplete. It lacks details on parameter usage, behavioral traits (e.g., pagination, errors), and output format, which are essential for an agent to use this tool effectively in a GitLab context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, so the description must compensate. It only mentions 'specific GitLab group' (hinting at 'group_id') but doesn't explain any of the 10 parameters, including key ones like 'archived', 'include_subgroups', or 'visibility'. This leaves most parameter meanings undocumented.

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 clearly states the verb ('List') and resource ('projects (repositories) within a specific GitLab group'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'list_issues' or 'list_merge_requests' beyond the resource type, which keeps it from a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing group access), exclusions, or comparisons to similar tools like 'search_repositories' or 'list_commits', leaving the agent to infer usage context.

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

Related 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/yoda-digital/mcp-gitlab-server'

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