gitlab_get_project
Retrieve complete project metadata, settings, and statistics from a GitLab repository using the project ID or path. Use to verify configurations or access detailed project information for management tasks.
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 main handler function for the gitlab_get_project tool. Extracts the required project_id from arguments and delegates to the GitLabClient.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)
- MCP tool schema definition specifying the input requirements: a required project_id string parameter.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/tool_handlers.py:1023-1023 (registration)Registration of the tool name to its handler function in the central TOOL_HANDLERS dictionary used by the MCP server.TOOL_GET_PROJECT: handle_get_project,
- Helper function used by the handler to validate and extract the required project_id argument, raising ValueError if missing.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]
- src/mcp_gitlab/constants.py:178-178 (helper)Constant definition for the tool name string used across the codebase for consistency.TOOL_GET_PROJECT = "gitlab_get_project"