Skip to content

feat(chat): add compatibility with algolia mcp search tool [DASH-2294]#6904

Merged
Haroenv merged 2 commits intomasterfrom
feat-support-algolia-mcp-search-tool-dash-2294
Feb 19, 2026
Merged

feat(chat): add compatibility with algolia mcp search tool [DASH-2294]#6904
Haroenv merged 2 commits intomasterfrom
feat-support-algolia-mcp-search-tool-dash-2294

Conversation

@kombucha
Copy link
Copy Markdown
Contributor

@kombucha kombucha commented Feb 17, 2026

Summary

Fixes DASH-2294
Adds compatibility with the Algolia MCP Server search tool.

The MCP Server names search tools with a suffix (e.g., algolia_search_index_indexName) instead of just algolia_search_index. This PR adds a shim that falls back to the algolia_search_index tool implementation when encountering these suffixed tool names.

Result

By default, the chat widget now works with both:

  • Standard algolia_search_index tool calls
  • MCP Server style algolia_search_index_* tool calls

Testing

  • Added a couple of unit tests ✅
  • Tested manually by pointing one of the examples to a locally running instance
yarn --cwd examples/js/default-theme start
Screenshot 2026-02-18 at 17 51 33

@kombucha kombucha self-assigned this Feb 17, 2026
@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci bot commented Feb 17, 2026

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 80970da:

Sandbox Source
example-instantsearch-getting-started Configuration
example-react-instantsearch-getting-started Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-react-instantsearch-next-routing-example Configuration
example-vue-instantsearch-getting-started Configuration

@kombucha kombucha force-pushed the feat-support-algolia-mcp-search-tool-dash-2294 branch 3 times, most recently from c8999ed to 8438de3 Compare February 17, 2026 21:10
@kombucha kombucha force-pushed the feat-support-algolia-mcp-search-tool-dash-2294 branch from b6ada7f to de0a99b Compare February 18, 2026 16:36
@kombucha kombucha marked this pull request as ready for review February 18, 2026 16:58
Copy link
Copy Markdown
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

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

you can update the bundlesize for InstantSearch.js development to give it more margin.

Just wondering why the patch happens both in the connector and the InstantSearch.js widget (but not react), isn't one of those redundant?

I think it also could be interesting to add a test to the common test suite (tests/common/widgets/chat)

Comment on lines +504 to +506
if (!widgetTool && key.startsWith(`${SearchIndexToolType}_`)) {
widgetTool = tools[SearchIndexToolType];
}
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.

we did the shim in the InstantSearch.js widget, but not the React InstantSearch widget, is that on purpose?

Copy link
Copy Markdown
Contributor Author

@kombucha kombucha Feb 19, 2026

Choose a reason for hiding this comment

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

It should be handled for the react flavour too.
The tools config is passed down through a few layers of component and is finally handled in packages/instantsearch-ui-components/src/components/chat/ChatMessage.tsx which I updated 👍

Copy link
Copy Markdown
Contributor

@Haroenv Haroenv Feb 19, 2026

Choose a reason for hiding this comment

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

makes sense! This probably changes with #6874 that's just for @shaejaz to take in account

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.

I think this would remain the same since you still need to map a tool into one with a layoutComponent in the js chat widget (and not in react) for it to be consumable in ui-components.

I'll try to see if this can be avoided in my PR tho.

@Haroenv Haroenv requested review from shaejaz and removed request for FabienMotte February 19, 2026 09:59
Copy link
Copy Markdown
Contributor

@shaejaz shaejaz left a comment

Choose a reason for hiding this comment

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

lgtm! we do most of the chat unit testing in the common test suite, but this is good for now; can be added there later.

Comment on lines +504 to +506
if (!widgetTool && key.startsWith(`${SearchIndexToolType}_`)) {
widgetTool = tools[SearchIndexToolType];
}
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.

I think this would remain the same since you still need to map a tool into one with a layoutComponent in the js chat widget (and not in react) for it to be consumable in ui-components.

I'll try to see if this can be avoided in my PR tho.

@Haroenv Haroenv merged commit adf1037 into master Feb 19, 2026
14 checks passed
@Haroenv Haroenv deleted the feat-support-algolia-mcp-search-tool-dash-2294 branch February 19, 2026 13:51
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.

3 participants