gitlab_list_projects
Access and list your GitLab projects with details like ID, name, description, and URL. Filter by ownership or search terms, and use pagination to browse results efficiently.
Instructions
List accessible GitLab projects Returns: Array of project summaries with ID, name, description, URL Use when: Browsing projects, finding project IDs Pagination: Yes (default 20 per page) Filtering: By ownership, name search
Example response: [{ "id": 12345, "name": "my-project", "path_with_namespace": "group/my-project", "description": "Project description", "web_url": "https://gitlab.com/group/my-project" }]
Related tools:
gitlab_get_project: Get full project details
gitlab_search_projects: Search all GitLab projects
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owned | No | Filter for owned projects only Type: boolean Default: false Options: - true: Only projects where you are the owner - false: All accessible projects Use case: Quickly find your personal projects | |
| 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 | |
| search | No | Search query Type: string Matching: Case-insensitive, partial matching Searches in: Project names and descriptions Examples: - 'frontend' (finds 'frontend-app', 'old-frontend', etc.) - 'API' (matches 'api', 'API', 'GraphQL-API', etc.) Tip: Use specific terms for better results for projects |
Implementation Reference
- src/mcp_gitlab/tool_handlers.py:85-92 (handler)The core handler function that implements the gitlab_list_projects tool. Extracts parameters from arguments and calls the GitLab client's get_projects method to fetch the list of projects."""Handle listing projects""" owned = get_argument(arguments, "owned", False) search = get_argument(arguments, "search") per_page = get_argument(arguments, "per_page", DEFAULT_PAGE_SIZE) page = get_argument(arguments, "page", 1) return client.get_projects(owned=owned, search=search, per_page=per_page, page=page)
- MCP tool schema definition specifying input parameters (owned, search, per_page, page) and their types, descriptions, and constraints for gitlab_list_projects.name=TOOL_LIST_PROJECTS, description=desc.DESC_LIST_PROJECTS, inputSchema={ "type": "object", "properties": { "owned": {"type": "boolean", "description": desc.DESC_OWNED_PROJECTS, "default": False}, "search": {"type": "string", "description": desc.DESC_SEARCH_TERM + " for projects"}, "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/tool_handlers.py:1004-1004 (registration)Registration of the gitlab_list_projects tool in the TOOL_HANDLERS dictionary mapping tool name to its handler function.TOOL_LIST_PROJECTS: handle_list_projects,
- src/mcp_gitlab/server.py:167-178 (registration)MCP server registration of gitlab_list_projects tool including schema in the list_tools handler.name=TOOL_LIST_PROJECTS, description=desc.DESC_LIST_PROJECTS, inputSchema={ "type": "object", "properties": { "owned": {"type": "boolean", "description": desc.DESC_OWNED_PROJECTS, "default": False}, "search": {"type": "string", "description": desc.DESC_SEARCH_TERM + " for projects"}, "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:177-177 (helper)Constant definition for the tool name 'gitlab_list_projects' used throughout the codebase for consistency.TOOL_LIST_PROJECTS = "gitlab_list_projects"