Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
ownedNoFilter 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
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
searchNoSearch 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

  • 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} } } ),
  • 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,
  • 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} } } ),
  • Constant definition for the tool name 'gitlab_list_projects' used throughout the codebase for consistency.
    TOOL_LIST_PROJECTS = "gitlab_list_projects"

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