Skip to main content
Glama

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
NameRequiredDescriptionDefault
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
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
project_idNoProject 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
queryNoSearch 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

  • 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)
  • 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} } } ),
  • 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} } } ),
  • Constant defining the exact tool name string used throughout the codebase for registration and references.
    TOOL_LIST_PROJECT_MEMBERS = "gitlab_list_project_members"

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

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