gitlab_get_issue
Retrieve complete details of a specific issue from GitLab, including its description, comments count, and time statistics, using the issue's internal ID (IID).
Instructions
Get complete issue details Returns: Full issue data including description, comments count Use when: Need complete issue information Required: Issue IID (e.g., 123 for issue #123)
What's IID?: Internal ID - the issue number shown in GitLab Example: For issue #123, use iid=123
Returns: { "iid": 123, "title": "Fix login bug", "description": "Detailed bug description...", "state": "opened", "labels": ["bug"], "milestone": {"title": "v2.0"}, "time_stats": { "time_estimate": 7200, "total_time_spent": 3600 } }
Related tools:
gitlab_list_issues: Find issues
gitlab_add_issue_comment: Add comment
gitlab_update_issue: Modify issue
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issue_iid | Yes | Issue number (IID - Internal ID) Type: integer Format: Project-specific issue number (without #) Required: Yes Examples: - 123 (for issue #123) - 4567 (for issue #4567) How to find: Look at issue URL or title - URL: https://gitlab.com/group/project/-/issues/123 → use 123 - Title: "Fix login bug (#123)" → use 123 Note: This is NOT the global issue ID | |
| project_id | No | Project identifier (auto-detected if not provided) Type: integer OR string Format: numeric ID or 'namespace/project' Optional: Yes - auto-detects from current git repository Examples: - 12345 (numeric ID) - 'gitlab-org/gitlab' (namespace/project path) - 'my-group/my-subgroup/my-project' (nested groups) Note: If in a git repo with GitLab remote, this can be omitted |
Implementation Reference
- src/mcp_gitlab/tool_handlers.py:123-129 (handler)The handler function that implements the core logic for the gitlab_get_issue tool. It detects or requires the project ID, requires the issue IID, and calls the GitLabClient to fetch the issue details.def handle_get_issue(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> Dict[str, Any]: """Handle getting single issue""" project_id = require_project_id(client, arguments) issue_iid = require_argument(arguments, "issue_iid") return client.get_issue(project_id, issue_iid)
- Defines the MCP tool schema including name, description, and input schema (requires issue_iid, optional project_id).types.Tool( name=TOOL_GET_ISSUE, description=desc.DESC_GET_ISSUE, inputSchema={ "type": "object", "properties": { "project_id": {"type": "string", "description": desc.DESC_PROJECT_ID}, "issue_iid": {"type": "integer", "description": desc.DESC_ISSUE_IID} }, "required": ["issue_iid"] } ),
- src/mcp_gitlab/tool_handlers.py:1031-1032 (registration)Registers the handle_get_issue function to the TOOL_GET_ISSUE name in the TOOL_HANDLERS dictionary used by the MCP server.TOOL_GET_ISSUE: handle_get_issue, TOOL_GET_MERGE_REQUEST: handle_get_merge_request,
- src/mcp_gitlab/constants.py:216-216 (helper)Defines the constant string name for the gitlab_get_issue tool used across the codebase.TOOL_GET_ISSUE = "gitlab_get_issue"
- src/mcp_gitlab/server.py:278-289 (registration)Registers the gitlab_get_issue tool in the MCP server's list_tools() method with schema and description.types.Tool( name="gitlab_get_issue", description=desc.DESC_GET_ISSUE, inputSchema={ "type": "object", "properties": { "project_id": {"type": "string", "description": desc.DESC_PROJECT_ID}, "issue_iid": {"type": "integer", "description": desc.DESC_ISSUE_IID} }, "required": ["issue_iid"] } ),