gitlab_get_issue
Retrieve complete GitLab issue details including description, labels, milestone, and time tracking data to analyze project tasks and track progress.
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 |
|---|---|---|---|
| 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 | |
| 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 |
Implementation Reference
- src/mcp_gitlab/tool_handlers.py:123-129 (handler)The core handler function that implements the logic for the 'gitlab_get_issue' tool. It determines the project ID using git detection if not provided, requires the 'issue_iid' argument, and calls the GitLab client's get_issue method 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)
- The input schema and metadata definition for the 'gitlab_get_issue' tool, specifying that 'issue_iid' is required (integer) and 'project_id' is optional (string). This is used for MCP tool registration.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-1031 (registration)The registration mapping that associates the tool name 'gitlab_get_issue' (via TOOL_GET_ISSUE constant) with its handler function 'handle_get_issue'. This dict is used by the MCP server to dispatch tool calls.TOOL_GET_ISSUE: handle_get_issue,
- src/mcp_gitlab/constants.py:216-216 (helper)Constant definition for the tool name 'gitlab_get_issue', used consistently across handler registration, schemas, and descriptions.TOOL_GET_ISSUE = "gitlab_get_issue"