fix(ai-proxy): throw on duplicate tool names, add source-id disambiguation#1523
Merged
fix(ai-proxy): throw on duplicate tool names, add source-id disambiguation#1523
Conversation
1 new issue
|
3079ce4 to
1148b14
Compare
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (1)
🛟 Help
|
…ation When two MCP servers expose tools with the same name, invokeTool now throws AIBadRequestError instead of silently using the first match. A new optional source-id query parameter allows the frontend to disambiguate by specifying which tool source to invoke. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1148b14 to
a33512f
Compare
nbouliol
approved these changes
Apr 1, 2026
forest-bot
added a commit
that referenced
this pull request
Apr 1, 2026
## @forestadmin/ai-proxy [1.7.2](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/ai-proxy@1.7.1...@forestadmin/ai-proxy@1.7.2) (2026-04-01) ### Bug Fixes * **ai-proxy:** throw on duplicate tool names, add source-id disambiguation ([#1523](#1523)) ([7113983](7113983))
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.

Summary
invokeToolnow throwsAIBadRequestErrorwhen multiple tools match the same name, instead of silently invoking the first onesource-idquery parameter oninvoke-remote-toolroute to disambiguate between tools with the same name from different sourcesTest plan
🤖 Generated with Claude Code
Note
Throw on duplicate tool names and add
source-iddisambiguation toRemoteTools.invokeToolRemoteTools.invokeToolin remote-tools.ts now accepts an optionalsourceIdparameter and filters matches by both tool name and source ID.source-idis provided, it throwsAIBadRequestErrorlisting the conflicting source IDs.invoke-remote-toolroute in router.ts forwards the new optionalsource-idquery parameter toinvokeTool.source-idfield.Macroscope summarized a33512f.