Commit 4653773
fix(mcp): match alias/server_name in _resolve_mcp_server_for_tool_call
The registry lookup in _resolve_mcp_server_for_tool_call previously only
compared candidate.name against the provided server_name, but tool name
prefixes can be derived from a server's alias or server_name (see
get_server_prefix). When the tool→server mapping is empty/stale (cold
start, dynamic tools), the lookup would fail for alias-configured
servers even though get_mcp_server_by_name (used by the REST path)
matches alias, server_name, and name.
Match the same priority of identifiers in both the registry pass and
the unprefixed fallback so the MCP protocol call_tool path is
consistent with the REST path.
Co-authored-by: Yassin Kortam <yassin@berri.ai>1 parent d2438b5 commit 4653773
1 file changed
Lines changed: 16 additions & 6 deletions
Lines changed: 16 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2828 | 2828 | | |
2829 | 2829 | | |
2830 | 2830 | | |
| 2831 | + | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
| 2835 | + | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
| 2844 | + | |
2831 | 2845 | | |
2832 | 2846 | | |
2833 | | - | |
2834 | | - | |
2835 | | - | |
| 2847 | + | |
2836 | 2848 | | |
2837 | 2849 | | |
2838 | 2850 | | |
2839 | 2851 | | |
2840 | 2852 | | |
2841 | 2853 | | |
2842 | | - | |
2843 | | - | |
2844 | | - | |
| 2854 | + | |
2845 | 2855 | | |
2846 | 2856 | | |
2847 | 2857 | | |
| |||
0 commit comments