gitlab_get_project
Retrieve complete project metadata and configuration details from GitLab using a project ID or path. Returns settings, statistics, and full project information for analysis or verification.
Instructions
Get detailed project information Returns: Complete project metadata, settings, statistics Use when: Need full project details, checking configuration Required: Project ID or path
Example response: { "id": 12345, "name": "my-project", "path_with_namespace": "group/my-project", "default_branch": "main", "visibility": "private", "issues_enabled": true, "merge_requests_enabled": true, "wiki_enabled": true, "statistics": { "commit_count": 1024, "repository_size": 15728640 } }
Related tools:
gitlab_list_projects: Find projects
gitlab_get_current_project: Auto-detect from git
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Project identifier (required) Type: integer OR string Format: numeric ID or 'namespace/project' Required: Yes Examples: - 12345 (numeric ID from project settings) - 'gitlab-org/gitlab' (full path from URL) - 'my-company/backend/api-service' (nested groups) How to find: Check project URL or Settings > General > Project ID |
Implementation Reference
- src/mcp_gitlab/tool_handlers.py:94-98 (handler)The core handler function for the 'gitlab_get_project' tool. It extracts the required 'project_id' from arguments and calls the GitLabClient's get_project method to fetch project details.def handle_get_project(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> Dict[str, Any]: """Handle getting single project""" project_id = require_argument(arguments, "project_id") return client.get_project(project_id)
- src/mcp_gitlab/tool_handlers.py:1023-1024 (registration)Registration of the handler function in the TOOL_HANDLERS dictionary, mapping 'gitlab_get_project' to handle_get_project.TOOL_GET_PROJECT: handle_get_project, TOOL_GET_CURRENT_PROJECT: handle_get_current_project,
- src/mcp_gitlab/server.py:180-188 (schema)Tool schema definition in server.py's list_tools handler, specifying input schema requiring 'project_id' as string.name=TOOL_GET_PROJECT, description=desc.DESC_GET_PROJECT, inputSchema={ "type": "object", "properties": { "project_id": {"type": "string", "description": desc.DESC_PROJECT_ID_REQUIRED} }, "required": ["project_id"] }
- src/mcp_gitlab/constants.py:178-178 (registration)Constant definition for the tool name 'gitlab_get_project', used across the codebase for consistency.TOOL_GET_PROJECT = "gitlab_get_project"
- Helper function used by the handler to validate and extract the required 'project_id' argument.def require_argument(arguments: Optional[Dict[str, Any]], key: str, error_msg: Optional[str] = None) -> Any: """Get required argument or raise ValueError""" if not arguments or key not in arguments: raise ValueError(error_msg or f"{key} is required") return arguments[key]