Add get_work_item_types MCP tool for namespace type discovery
What does this MR do and why?
Adds a new MCP tool get_work_item_types that lets Duo agents discover the work item types available in a given namespace (group or project), including system-defined types (Issue, Epic, Task, …) and custom types (CWITs).
This is the first iteration of the work outlined in #592587.
Tool shape
Each entry in workItemTypes returns:
| Field | Why |
|---|---|
id |
Global ID for use as workItemTypeId in workItemCreate |
name |
Human-readable type name (can be in any language / renamed) |
iconName |
For surfaces that render type chips |
widgetDefinitions[].type |
List of widget identifiers (e.g. ASSIGNEES, LABELS, HIERARCHY) so the agent knows which fields it can set on items of that type |
Scope - intentionally minimal
Per the discussion in the issue (note 3173826951, note 3184213856), this MR ships the smallest useful surface that satisfies acceptance criteria 1 + 3 in the issue.
Deferred to follow-ups:
- Per-widget detail fields (
allowsMultipleAssignees,allowedChildTypes/allowedParentTypes, custom field definitions). These bring in EE-only types and theee_else_ce/work_item_type.fragment.graphqlsplit — worth doing once we have a concrete agent need. - Organization-level fallback for Self-Managed (
organization { workItemTypes { ... } }).
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.
How to set up and validate locally
-
Enable the feature flags in the Rails console:
Feature.enable(:mcp_client) Feature.enable(:mcp_catalog_agent_tools) -
Create a copy of the Planner agent in your AI Catalog and enable it for your project.
-
Add the
get work item typestool to the agent. -
Create a custom work item type for your group.
-
Go to your group, open Duo chat, and select your agent.
-
Ask the agent to
List available work item types. -
The response should include all available work item types along with the custom work item type you created.
Related
Related issue: #592587
cc @acroitor @msaleiko @fredericcaplette @mmacfarlane - marking as Draft so we can align on scope before requesting review.