Implements graphql mcp get work item notes query tool
What does this MR do and why?
AI Summary:
This merge request implements a GraphQL-based MCP (Model Context Protocol) tool for retrieving work item notes (comments). The implementation follows the established pattern for GraphQL MCP tools in the codebase.
Key changes:
-
New GraphQL tool class (
GetWorkItemNotesTool) that queries work item notes using the GraphQL API, supporting pagination with cursor-based navigation (after/before, first/last parameters) -
Service layer (
GraphqlGetWorkItemNotesService) that wraps the tool and provides the MCP interface with comprehensive input schema validation for work item identification (URL, group_id, project_id, work_item_iid) and pagination controls -
Tool registration in the MCP tools manager, making
get_workitem_notesavailable alongside the existingcreate_workitem_notetool - Comprehensive test coverage with 449 lines of specs for the tool and 209 lines for the service, covering various scenarios including URL-based identification, group/project work items, pagination, error handling, and permission checks
Technical details:
The tool extracts notes from the work item's widgets structure and returns formatted JSON containing note metadata (id, body, author, timestamps, discussion info) along with pagination information (count, pageInfo with cursors).
References
- #581892 (closed)
- Dependent MR: Implements graphql mcp create work item note mu... (!213398 - merged)
- Base implementation: !211553 (merged)
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
You can test get_workitem_notes tool using MCP inspector.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Naman Jagdish Gala