gitlab_search_projects
Search across all GitLab projects, including public and private ones, to find matches in project names and descriptions using case-insensitive, partial matching queries.
Instructions
Search all GitLab projects Returns: Projects matching search query Use when: Finding projects across GitLab Scope: All public projects + your private projects
Different from list_projects:
Searches ALL of GitLab
list_projects only shows YOUR accessible projects
Related tools:
gitlab_list_projects: Your projects only
gitlab_search_in_project: Search within project
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 | |
| search | Yes | 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 |
Implementation Reference
- src/mcp_gitlab/tool_handlers.py:217-224 (handler)The handler function for 'gitlab_search_projects' that validates input parameters (search term required, optional pagination) and delegates to GitLabClient.search_projects.def handle_search_projects(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> Dict[str, Any]: """Handle searching projects""" search = require_argument(arguments, "search") per_page = get_argument(arguments, "per_page", DEFAULT_PAGE_SIZE) page = get_argument(arguments, "page", 1) return client.search_projects(search, per_page, page)
- src/mcp_gitlab/tool_handlers.py:1056-1056 (registration)Maps the tool name TOOL_SEARCH_PROJECTS ("gitlab_search_projects") to its handler function in the TOOL_HANDLERS dictionary.TOOL_SEARCH_PROJECTS: handle_search_projects,
- src/mcp_gitlab/constants.py:226-226 (helper)Constant definition for the tool name used throughout the codebase.TOOL_SEARCH_PROJECTS = "gitlab_search_projects"
- Improved tool description for better LLM usability, serving as input/output guidance and schema documentation."gitlab_search_projects": { "description": """Search for GitLab projects across the entire instance based on name or description. **Use this tool when you need to find projects but don't know their exact names or paths.** Examples: - Find projects to contribute to: search_projects("react dashboard") - Discover similar projects: search_projects("microservice") - Organization-wide project discovery For searching within a specific project's content, use 'search_in_project' instead.""" },