gitlab_summarize_issue
Condense GitLab issue details into concise summaries with AI-friendly truncation. Preserves key information, removes redundancy, and fits context limits for efficient processing.
Instructions
Generate AI-friendly issue summary Returns: Condensed issue information Use when: Processing issues with AI Includes: Title, description, comments, status
Smart truncation:
Preserves key information
Removes redundancy
Fits context limits
Related tools:
gitlab_get_issue: Full details
gitlab_summarize_pipeline: Pipeline summaries
Input Schema
TableJSON 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 | |
| max_length | No | Maximum summary length Type: integer Range: 100-5000 Default: 500 Examples: - 300: Very concise summary - 500: Standard summary - 1000: Detailed summary Use case: Control output size for LLM context | |
| 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:482-488 (handler)The handler function that implements the core logic for the gitlab_summarize_issue tool. It extracts required parameters (project_id, issue_iid, optional max_length) and delegates to GitLabClient.summarize_issue() for execution.def handle_summarize_issue(client: GitLabClient, arguments: Optional[Dict[str, Any]]) -> Dict[str, Any]: """Handle summarizing an issue""" project_id = require_project_id(client, arguments) issue_iid = require_argument(arguments, "issue_iid") max_length = get_argument(arguments, "max_length", 500) return client.summarize_issue(project_id, issue_iid, max_length)
- src/mcp_gitlab/tool_handlers.py:1002-1097 (registration)The TOOL_HANDLERS dictionary maps the tool name TOOL_SUMMARIZE_ISSUE ("gitlab_summarize_issue") to its handler function handle_summarize_issue. This mapping is used by server.py to dispatch tool calls.TOOL_HANDLERS = { # List tools TOOL_LIST_PROJECTS: handle_list_projects, TOOL_LIST_ISSUES: handle_list_issues, TOOL_LIST_MRS: handle_list_merge_requests, TOOL_LIST_BRANCHES: handle_list_branches, TOOL_LIST_PIPELINES: handle_list_pipelines, TOOL_LIST_USER_EVENTS: handle_get_user_events, TOOL_LIST_COMMITS: handle_get_commits, TOOL_LIST_REPOSITORY_TREE: handle_get_repository_tree, TOOL_LIST_TAGS: handle_get_tags, TOOL_LIST_RELEASES: handle_list_releases, TOOL_LIST_PROJECT_MEMBERS: handle_get_project_members, TOOL_LIST_PROJECT_HOOKS: handle_get_project_hooks, TOOL_LIST_GROUPS: handle_list_groups, TOOL_LIST_GROUP_PROJECTS: handle_list_group_projects, TOOL_LIST_SNIPPETS: handle_list_snippets, TOOL_LIST_PIPELINE_JOBS: handle_list_pipeline_jobs, TOOL_LIST_PROJECT_JOBS: handle_list_project_jobs, # Get tools TOOL_GET_PROJECT: handle_get_project, TOOL_GET_CURRENT_PROJECT: handle_get_current_project, TOOL_GET_MR_NOTES: handle_get_merge_request_notes, TOOL_GET_CURRENT_USER: handle_get_current_user, TOOL_GET_USER: handle_get_user, TOOL_GET_GROUP: handle_get_group, TOOL_GET_SNIPPET: handle_get_snippet, TOOL_DOWNLOAD_JOB_ARTIFACT: handle_download_job_artifact, TOOL_GET_ISSUE: handle_get_issue, TOOL_GET_MERGE_REQUEST: handle_get_merge_request, TOOL_GET_FILE_CONTENT: handle_get_file_content, TOOL_GET_COMMIT: handle_get_commit, TOOL_GET_COMMIT_DIFF: handle_get_commit_diff, TOOL_GET_MR_APPROVALS: handle_get_merge_request_approvals, TOOL_GET_MR_DISCUSSIONS: handle_get_merge_request_discussions, TOOL_GET_MR_CHANGES: handle_get_merge_request_changes, # Action tools TOOL_CREATE_SNIPPET: handle_create_snippet, TOOL_UPDATE_SNIPPET: handle_update_snippet, TOOL_UPDATE_MR: handle_update_merge_request, TOOL_CLOSE_MR: handle_close_merge_request, TOOL_MERGE_MR: handle_merge_merge_request, TOOL_REBASE_MR: handle_rebase_merge_request, TOOL_APPROVE_MR: handle_approve_merge_request, TOOL_ADD_ISSUE_COMMENT: handle_add_issue_comment, TOOL_ADD_MR_COMMENT: handle_add_merge_request_comment, TOOL_RESOLVE_DISCUSSION: handle_resolve_discussion, TOOL_CREATE_COMMIT: handle_create_commit, TOOL_CHERRY_PICK_COMMIT: handle_cherry_pick_commit, TOOL_COMPARE_REFS: handle_compare_refs, # Search tools TOOL_SEARCH_PROJECTS: handle_search_projects, TOOL_SEARCH_IN_PROJECT: handle_search_in_project, # AI and Advanced Tools TOOL_SUMMARIZE_MR: handle_summarize_merge_request, TOOL_SUMMARIZE_ISSUE: handle_summarize_issue, TOOL_SUMMARIZE_PIPELINE: handle_summarize_pipeline, TOOL_SMART_DIFF: handle_smart_diff, TOOL_SAFE_PREVIEW_COMMIT: handle_safe_preview_commit, TOOL_BATCH_OPERATIONS: handle_batch_operations, # Job and Artifact handlers TOOL_LIST_PIPELINE_JOBS: handle_list_pipeline_jobs, TOOL_DOWNLOAD_JOB_ARTIFACT: handle_download_job_artifact, TOOL_LIST_PROJECT_JOBS: handle_list_project_jobs, # User & Profile handlers TOOL_SEARCH_USER: handle_search_user, TOOL_GET_USER_DETAILS: handle_get_user_details, TOOL_GET_MY_PROFILE: handle_get_my_profile, TOOL_GET_USER_CONTRIBUTIONS_SUMMARY: handle_get_user_contributions_summary, TOOL_GET_USER_ACTIVITY_FEED: handle_get_user_activity_feed, # User's Issues & MRs handlers TOOL_GET_USER_OPEN_MRS: handle_get_user_open_mrs, TOOL_GET_USER_REVIEW_REQUESTS: handle_get_user_review_requests, TOOL_GET_USER_OPEN_ISSUES: handle_get_user_open_issues, TOOL_GET_USER_REPORTED_ISSUES: handle_get_user_reported_issues, TOOL_GET_USER_RESOLVED_ISSUES: handle_get_user_resolved_issues, # User's Code & Commits handlers TOOL_GET_USER_COMMITS: handle_get_user_commits, TOOL_GET_USER_MERGE_COMMITS: handle_get_user_merge_commits, TOOL_GET_USER_CODE_CHANGES_SUMMARY: handle_get_user_code_changes_summary, TOOL_GET_USER_SNIPPETS: handle_get_user_snippets, # User's Comments & Discussions handlers TOOL_GET_USER_ISSUE_COMMENTS: handle_get_user_issue_comments, TOOL_GET_USER_MR_COMMENTS: handle_get_user_mr_comments, TOOL_GET_USER_DISCUSSION_THREADS: handle_get_user_discussion_threads, TOOL_GET_USER_RESOLVED_THREADS: handle_get_user_resolved_threads, }
- Defines the input schema, parameters, and description for the gitlab_summarize_issue tool, including required fields and validation.types.Tool( name=TOOL_SUMMARIZE_ISSUE, description=desc.DESC_SUMMARIZE_ISSUE, inputSchema={ "type": "object", "properties": { "project_id": {"type": "string", "description": desc.DESC_PROJECT_ID}, "issue_iid": {"type": "integer", "description": desc.DESC_ISSUE_IID}, "max_length": {"type": "integer", "description": desc.DESC_MAX_LENGTH, "default": 500} }, "required": ["issue_iid"] }
- src/mcp_gitlab/constants.py:244-244 (helper)Constant definition for the tool name used across registration, schemas, and tests.TOOL_SUMMARIZE_ISSUE = "gitlab_summarize_issue"
- src/mcp_gitlab/server.py:827-838 (registration)MCP tool registration in server.py's list_tools() method, which exposes the tool to the MCP protocol with schema and description.name="gitlab_summarize_issue", description=desc.DESC_SUMMARIZE_ISSUE, inputSchema={ "type": "object", "properties": { "project_id": {"type": "string", "description": desc.DESC_PROJECT_ID}, "issue_iid": {"type": "integer", "description": desc.DESC_ISSUE_IID}, "max_length": {"type": "integer", "description": desc.DESC_MAX_LENGTH, "default": 500} }, "required": ["issue_iid"] } ),