Add parent_iid filter to MCP list_work_items tool

What does this MR do and why?

Adds a parent_iid filter to the MCP list_work_items tool so agents and MCP clients can list direct child work items of a parent issue or epic by IID within the specified project or group.

  • Adds parent_iid (type: 'integer') to ListWorkItemsService input schema.
  • Resolves the parent work item via find_work_item_in_parent! in ListWorkItemsTool#hierarchy_filters and passes hierarchyFilters: { 'parentIds' => [parent.to_global_id.to_s] } to the GraphQL query.
  • Classifies parent_iid in ee/spec/lib/ai/tool_rules/governable_tools_container_spec.rb under not_a_container.
  • Adds documentation for parent_iid to doc/user/model_context_protocol/mcp_server_tools.md.

Closes #635909 (closed)

How to set up and validate locally

  1. Run RSpec specs:
bundle exec rspec spec/services/mcp/tools/work_items/list_work_items_tool_spec.rb \
  spec/services/mcp/tools/work_items/list_work_items_service_spec.rb \
  ee/spec/lib/ai/tool_rules/governable_tools_container_spec.rb
  1. Query list_work_items with parent_iid: <iid> to confirm children filtering.
Edited by Pavan Kumar Sadashiv

Merge request reports

Loading
Loading