feat(askai): Aggregate MCP search tool calls#2891
Open
8bittitan wants to merge 7 commits into
Open
Conversation
✅ Deploy Preview for docsearch-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 24 |
| Duplication | 4 |
TIP This summary will be updated as you push new changes.
LorrisSaintGenez
approved these changes
Jun 2, 2026
Collaborator
LorrisSaintGenez
left a comment
There was a problem hiding this comment.
Non-blocking comment
NatanTechofNY
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
When Ask AI runs searches through the Algolia MCP server, each query comes back as a separate
algolia_search_index(oralgolia_search_index_*) tool call. Previously, only the nativesearchIndextool was recognized for aggregation, so MCP-backed searches were rendered as a noisy list of individual tool-call entries instead of being collapsed into a single grouped result. This made multi-query MCP searches harder to scan and inconsistent with how native search is presented.This change teaches the grouping logic to treat MCP search tools as first-class search results so consecutive searches — native or MCP, or a mix of both — are aggregated into one clean entry.
What this enables
searchIndexbehavior.output, MCP on itsinput), and empty/whitespace queries are skipped.algolia_search_indexprefix (e.g.algolia_search_indexer) are intentionally excluded to avoid false grouping.Notes
isSearchToolPart,isSearchOutputPart, etc.) were centralized inutils/ai.tsand removed fromToolCall.tsxto keep the search-tool detection logic in one place.AGENTS.mdwas updated to reflect the current toolchain (Playwright instead of Cypress,--runfor tests).Dependencies
v5after feat(askai): Feedback notes and tags #2890 has been merged