Skip to main content
Glama

list_project_members

Retrieve and display all members of a GitLab project to manage team access and permissions. Specify project ID and pagination for efficient member listing.

Instructions

列出專案成員

Args: project_id: 專案 ID 或路徑 page: 頁碼 per_page: 每頁筆數

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
pageNo
per_pageNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler function for listing project members in the MCP server.
    def list_project_members(project_id: int | str, page: int = 1,
                             per_page: int = 20) -> str:
        """列出專案成員
    
        Args:
            project_id: 專案 ID 或路徑
            page: 頁碼
            per_page: 每頁筆數
        """
        try:
            client = get_client()
            members = client.list_project_members(project_id, page=page, per_page=per_page)
            if not members:
                return "此專案沒有成員"
    
            access_levels = {10: "Guest", 20: "Reporter", 30: "Developer", 40: "Maintainer", 50: "Owner"}
            lines = [f"專案成員(共 {len(members)} 位):\n"]
            for m in members:
                level = access_levels.get(m.get("access_level", 0), "Unknown")
                lines.append(f"- {m.get('name', 'N/A')} (@{m.get('username', 'N/A')}) — {level}")
            return "\n".join(lines)
        except GitLabAPIError as e:
            return f"列出成員失敗: {str(e)}"
  • The underlying API client method that fetches the members from the GitLab REST API.
    def list_project_members(
        self, project_id: int | str, page: int = 1, per_page: int = 20
    ) -> list[dict]:
        """GET /projects/:id/members"""
        pid = self._resolve_project_id(project_id)
        params = {"page": page, "per_page": per_page}
        return self._get_json(f"/projects/{pid}/members", params=params)
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. It mentions pagination via 'page' and 'per_page' parameters, implying a list operation, but does not disclose behavioral traits like rate limits, authentication needs, error handling, or what the output contains (though an output schema exists). This leaves gaps for a tool with no annotations.

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 structured with a brief purpose statement followed by parameter explanations. It avoids unnecessary details, though it could be more front-loaded with key usage 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?

Given the tool's complexity (list operation with pagination), no annotations, and an output schema (which reduces need to explain returns), the description is partially complete. It covers basic purpose and parameters but lacks behavioral context and usage guidelines, making it adequate but with clear gaps.

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 semantics: it notes that 'project_id' can be an ID or path and that 'page' and 'per_page' are for pagination. However, with 0% schema description coverage and 3 parameters, this is insufficient to fully compensate. The baseline is lowered due to low coverage, but some value is added.

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

Purpose3/5

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

The description states the tool '列出專案成員' (list project members), which clearly indicates its purpose. However, it does not differentiate from sibling tools like 'list_projects' or 'list_branches' beyond the resource type, and the title is null, making it somewhat vague in context.

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, such as filtering members or handling specific project types. It lists parameters but does not explain usage context, prerequisites, 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/snowild/gitlab-mcp'

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