Add a work_item_types facet to the get_project MCP tool
What does this MR do and why?
Adds an include parameter to the get_project MCP tool with one facet, work_item_types. Passing include: ["work_item_types"] returns each work item type available in the project (global ID, name, icon name, and enabled widget types) alongside the existing project metadata.
An agent creating a work item needs to know which type names the project accepts and which widgets each type supports, otherwise save_work_item rejects the call. Work item types are scoped to one project, so they fit the include pattern get_pipeline already uses rather than a standalone tool. This extends the existing get_project tool, so no Tool Proposal was raised.
Without the facet the response is unchanged, so the tool stays on 0.1.0. get_work_item_types is untouched, since it is still the only way to read group-level types.
Closes #606643 (closed)
References
- Precedent for the facet pattern:
app/services/mcp/tools/pipelines/get_pipeline_tool.rb - Tool docs:
doc/user/model_context_protocol/mcp_server_tools.md
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
-
In GDK, run the tool directly against a seeded project, once without the facet (unchanged path) and once with it:
bin/rails runner ' user = User.find_by(username: "root") svc = Mcp::Tools::Projects::GetProjectService.new(name: "get_project") svc.set_cred(current_user: user) base = { project_id: "gitlab-org/gitlab-test" } puts JSON.pretty_generate( without_include: svc.execute(request: nil, params: { arguments: base })[:structuredContent], with_include: svc.execute(request: nil, params: { arguments: base.merge(include: ["work_item_types"]) })[:structuredContent] ) 'Expected: the first line lists the existing project keys only, with no
work_item_types, so callers that do not passincludeare unaffected. The second line prints one work item type with itsid,name,icon_name, andwidget_types. -
Confirm the schema advertises the facet:
bin/rails runner 'puts Mcp::Tools::Projects::GetProjectService.new(name: "get_project").input_schema[:properties][:include].inspect'Expected: an array property with
enum: ["work_item_types"]andmaxItems: 1. -
Run the specs:
bin/rspec spec/services/mcp/tools/projects/get_project_service_spec.rb \ spec/services/mcp/tools/projects/get_project_tool_spec.rb \ spec/services/mcp/tools/schema_defaults_spec.rb \ ee/spec/lib/ai/tool_rules/governable_tools_container_spec.rb
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.

