Draft: [skip ci] POC Add list_saved_views and save_saved_view MCP tools

What does this MR do and why?

POC for #631461. Saved views are getting harder to configure by hand, so this adds MCP tools that let agents find, create, and update them.

Two new tools in the work_items toolset:

  • list_saved_views (read-only). Lists saved views in a project or group, with search, subscribed_only, sort, and cursor pagination. Wraps namespace.savedViews. It doesn't select filters or filterWarnings, because those fields can only resolve for one saved view per request.
  • save_saved_view (write, non-destructive). No saved_view_id means create (workItemSavedViewCreate). With saved_view_id it updates (workItemSavedViewUpdate). This follows the save_ convention and copies the save_work_item pattern.

Notes on save_saved_view:

  • filters maps onto WorkItemSavedViewFilterInput. Keys can be snake_case or camelCase and are camelized before the call. That input already takes readable values like labelName, assigneeUsernames, and milestoneTitle, so agents don't need to look up IDs.
  • The response includes filterWarnings, so an agent can see when a filter value didn't resolve.
  • Create defaults: filters: {}, display_settings: {}, sort: CREATED_DESC. is_private falls back to the mutation default (true).
  • Governance: on update the tool names its target only by saved_view_id, so it declares container_arguments record: { saved_view_id: ... }, the same way get_saved_view_work_items does.

Delete, subscribe, unsubscribe, and reorder are out of scope for the POC. Per the conventions, delete_saved_view would be its own tool.

Demo

Duo Agentic Chat creates a shared saved view with four filters through save_saved_view: state is open, type is Issue, labels bug and frontend, and milestone Checkout v2.4. The view then shows the 6 matching issues out of 24 open ones. Recorded on GDK.

Status

  • Not tested yet. No specs run and no manual run. I need to set up Agentic AI on my GDK first.
  • No unit specs for the new tool and service classes yet. Only the specs that list every tool are updated.
  • An MCP Tool Proposal issue for the review board still needs to be opened.

Open questions:

  • Naming: save_saved_view or save_work_item_saved_view? Merge requests have their own saved views.
  • Is display_settings: {} valid on create against work_item_user_preference_display_settings.json, and is filters: {} accepted? I still need to check both on GDK.
  • On update, filters and display_settings replace the existing values. Should we merge instead?

How to set up and validate locally

  1. Enable the MCP server on GDK. See doc/development/duo_agent_platform/mcp/_index.md.
  2. gdk restart rails-web
  3. Call tools/list and confirm both tools show up.
  4. Call save_saved_view with group_id, name, and filters: {"state": "opened", "label_name": ["bug"]}.
  5. Call save_saved_view with the returned saved_view_id and a new name.
  6. Call list_saved_views for the group, then get_saved_view_work_items for the new view.

Related to #631461

🤖 Generated with Claude Code

Edited by Rajan Mistry

Merge request reports

Loading
Loading