Skip to content

fix: Agent Studio MCP search tool#2927

Open
8bittitan wants to merge 1 commit into
v5from
fix/agent-studio-mcp-search-tool
Open

fix: Agent Studio MCP search tool#2927
8bittitan wants to merge 1 commit into
v5from
fix/agent-studio-mcp-search-tool

Conversation

@8bittitan

@8bittitan 8bittitan commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

The Agent Studio MCP search tool changed its input shape. It now sends a queries array (with originalQuery and clickAnalytics) instead of a single top-level query string. Because the UI only knew how to read the old single-query input, MCP search calls rendered blank query labels and multi-query searches were collapsed into a single (often empty) entry.

This updates the type definitions and rendering to support the new multi-query payload while still parsing older stored tool calls that use the legacy single-query shape, so previously saved conversations keep rendering correctly.

Why

  • The MCP tool now issues multiple queries per call, and each one should be shown and be individually clickable.
  • Older conversations persisted with the previous input shape must not break, so query extraction handles both formats.
  • Centralizing query extraction in a single getSearchToolQueries helper removes the duplicated, format-specific parsing that was scattered across the tool call rendering and grouping logic.

Testing

  • Ask AI a question that triggers the Agent Studio MCP search tool and confirm each issued query renders as its own result row.
  • Confirm clicking (and keyboard Enter/Space on) a rendered query still fires the search-for-query action.
  • Trigger a call that returns multiple queries and verify empty or whitespace-only queries are filtered out.
  • Open an older conversation that used the previous single-query MCP payload and confirm the query still displays.
  • Run bun run test --run packages/docsearch-react/src/components/__tests__/ToolCall.test.tsx and the ai / groupConsecutiveToolResults test files.

@netlify

netlify Bot commented Jul 17, 2026

Copy link
Copy Markdown

Deploy Preview for docsearch-demo ready!

Name Link
🔨 Latest commit e4a6ddf
🔍 Latest deploy log https://app.netlify.com/projects/docsearch-demo/deploys/6a5a0e75a3baee0008936039
😎 Deploy Preview https://deploy-preview-2927--docsearch-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 17, 2026

Copy link
Copy Markdown

Deploy Preview for docsearch ready!

Name Link
🔨 Latest commit e4a6ddf
🔍 Latest deploy log https://app.netlify.com/projects/docsearch/deploys/6a5a0e750aebea00088d376e
😎 Deploy Preview https://deploy-preview-2927--docsearch.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@dylantientcheu dylantientcheu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

funny that the test diffs are even more than the actual code :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants