gitlab_list_project_members
Retrieve and manage GitLab project members, including access levels, with a searchable interface. Use to view direct or inherited permissions and identify team roles efficiently. Supports pagination for large teams.
Instructions
List project members Returns: Users with access levels Use when: Finding team members, permissions Shows: Direct and inherited members
Access levels:
10: Guest
20: Reporter
30: Developer
40: Maintainer
50: Owner
Related tools:
gitlab_add_project_member: Add member
gitlab_update_member_role: Change access
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page 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 | |
| per_page | No | Number 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 | |
| project_id | No | Project identifier (auto-detected if not provided) Type: integer OR string Format: numeric ID or 'namespace/project' Optional: Yes - auto-detects from current git repository Examples: - 12345 (numeric ID) - 'gitlab-org/gitlab' (namespace/project path) - 'my-group/my-subgroup/my-project' (nested groups) Note: If in a git repo with GitLab remote, this can be omitted | |
| query | No | Search query Type: string Format: Free text search Searches in: Usernames, names, emails Matching: Partial, case-insensitive Examples: - 'john' (finds 'john', 'johnny', 'Johnson') - 'admin' (finds users with admin in name) - 'example.com' (finds users with that email domain) |
Implementation Reference
- src/mcp_gitlab/tool_handlers.py:409-417 (handler)The main handler function that implements the tool logic. It resolves the project ID (auto-detecting from git if not provided), extracts optional query, per_page, and page parameters from arguments, and calls GitLabClient.get_project_members to fetch the list of project members.def handle_get_project_members(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> Dict[str, Any]: """Handle getting project members""" project_id = require_project_id(client, arguments) query = get_argument(arguments, "query") per_page = get_argument(arguments, "per_page", DEFAULT_PAGE_SIZE) page = get_argument(arguments, "page", 1) return client.get_project_members(project_id, query, per_page, page)
- src/mcp_gitlab/tool_handlers.py:1014-1014 (registration)Registration of the tool name to its handler function in the TOOL_HANDLERS dictionary, used by the server to dispatch tool calls.TOOL_LIST_PROJECT_MEMBERS: handle_get_project_members,
- Tool schema definition including input validation schema for parameters: project_id (string), query (string), per_page (integer 1-MAX_PAGE_SIZE), page (integer >=1).types.Tool( name=TOOL_LIST_PROJECT_MEMBERS, description=desc.DESC_LIST_PROJECT_MEMBERS, inputSchema={ "type": "object", "properties": { "project_id": {"type": "string", "description": desc.DESC_PROJECT_ID}, "query": {"type": "string", "description": desc.DESC_QUERY}, "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} } } ),
- src/mcp_gitlab/server.py:720-732 (registration)Tool registration in the server's list_tools() method, exposing the tool with its name, description, and input schema to MCP clients.types.Tool( name=TOOL_LIST_PROJECT_MEMBERS, description=desc.DESC_LIST_PROJECT_MEMBERS, inputSchema={ "type": "object", "properties": { "project_id": {"type": "string", "description": desc.DESC_PROJECT_ID}, "query": {"type": "string", "description": desc.DESC_QUERY}, "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} } } ),
- src/mcp_gitlab/constants.py:195-195 (helper)Constant defining the exact tool name string used throughout the codebase for registration and references.TOOL_LIST_PROJECT_MEMBERS = "gitlab_list_project_members"