Loading
Support batch label lookups in the GitLab MCP tool
What does this MR do and why?
Allows search_labels to look up multiple label names in one MCP tool call.
Helps agents recover when save_work_item rejects labels that do not exist, without making a separate tool call for every name.
Underlying GraphQL resolver still accepts one term per query. This change reduces agent tool calls, not backend GraphQL queries.
References
- Resolves #621662 (closed)
How to set up and validate locally
- Run the focused specs:
bin/rspec spec/services/mcp/tools/labels/search_tool_spec.rb spec/services/mcp/tools/labels/search_service_spec.rb - Verify that
0.2.0returns matching labels for multiple terms in one response, removes duplicate IDs, and rejects an empty array. - Verify that an explicitly requested
0.1.0call still accepts a string.