Skip to main content
Glama

list_project_members

Retrieve a comprehensive list of all members in a GitLab project, including inherited members, by specifying project ID, query, and pagination options.

Instructions

List all members of a GitLab project (including inherited members)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNo
per_pageNo
project_idNo
queryNo

Implementation Reference

  • Core handler function that lists project members (including inherited) via GitLab API /projects/{projectId}/members/all endpoint. Supports query, pagination params. Parses response with GitLabMembersResponseSchema.
    async listProjectMembers(
      projectId: string,
      options: {
        query?: string;
        page?: number;
        per_page?: number;
      } = {}
    ): Promise<GitLabMembersResponse> {
      const url = new URL(
        `${this.apiUrl}/projects/${encodeURIComponent(projectId)}/members/all`
      );
    
      // 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 data = await response.json();
      const totalCount = parseInt(response.headers.get("X-Total") || "0");
    
      return GitLabMembersResponseSchema.parse({
        count: totalCount,
        items: data
      });
    }
  • Input schema (Zod) for list_project_members tool defining required project_id and optional query/page/per_page params.
    export const ListProjectMembersSchema = z.object({
      project_id: z.string(),
      query: z.string().optional(),
      page: z.number().optional(),
      per_page: z.number().optional(),
    });
  • src/index.ts:268-272 (registration)
    Tool registration in ALL_TOOLS array: defines name, description, inputSchema (from ListProjectMembersSchema), readOnly flag.
      name: "list_project_members",
      description: "List all members of a GitLab project (including inherited members)",
      inputSchema: createJsonSchema(ListProjectMembersSchema),
      readOnly: true
    },
  • MCP server switch-case dispatcher: parses args with schema, extracts params, calls gitlabApi.listProjectMembers, returns formatted response.
    case "list_project_members": {
      const args = ListProjectMembersSchema.parse(request.params.arguments);
      const { project_id, ...options } = args;
      const members = await gitlabApi.listProjectMembers(project_id, options);
      return formatMembersResponse(members);
    }
  • Output response schema (Zod) for members list: count and array of GitLabMember objects.
    export const GitLabMembersResponseSchema = z.object({
      count: z.number(),
      items: z.array(GitLabMemberSchema)
    });
    
    export type GitLabMembersResponse = z.infer<typeof GitLabMembersResponseSchema>;
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool lists members, implying a read-only operation, but doesn't mention pagination behavior (despite page/per_page parameters), rate limits, authentication needs, or what the output looks like. For a tool with 4 parameters and no output schema, this leaves significant gaps in understanding how it behaves.

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 with zero wasted words. It front-loads the core purpose and includes a clarifying detail about inherited members. Every part earns its place, making it easy to parse quickly.

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 tool's complexity (4 parameters, no annotations, no output schema), the description is inadequate. It doesn't explain parameter usage, output format, or behavioral traits like pagination. While concise, it lacks the detail needed for an agent to use the tool effectively without trial and error.

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?

Schema description coverage is 0%, so the schema provides no parameter details. The description mentions 'inherited members', which relates to the 'query' parameter's potential use, but doesn't explain any of the 4 parameters (project_id, page, per_page, query) or their purposes. It adds minimal value beyond the schema, failing to compensate for the coverage gap.

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 ('members of a GitLab project'), making the purpose specific and understandable. It also specifies scope ('including inherited members'), which is helpful. However, it doesn't explicitly distinguish this tool from its sibling 'list_group_members', which could cause confusion about when to use each.

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 like 'list_group_members' or other listing tools. It mentions inherited members, which hints at context, but doesn't specify scenarios, prerequisites, or exclusions. Without explicit usage instructions, the agent must infer from tool names alone.

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