mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 09:17:53 +00:00
Use simple name for MCP tools where possible. (#4459)
This commit is contained in:
committed by
GitHub
parent
d7041a6595
commit
b5f5ea2c31
@@ -210,35 +210,31 @@ describe('ToolRegistry', () => {
|
||||
const mcpTool1_c = new DiscoveredMCPTool(
|
||||
mockCallable,
|
||||
server1Name,
|
||||
`${server1Name}__zebra-tool`,
|
||||
'zebra-tool',
|
||||
'd1',
|
||||
{},
|
||||
'zebra-tool',
|
||||
);
|
||||
const mcpTool1_a = new DiscoveredMCPTool(
|
||||
mockCallable,
|
||||
server1Name,
|
||||
`${server1Name}__apple-tool`,
|
||||
'apple-tool',
|
||||
'd2',
|
||||
{},
|
||||
'apple-tool',
|
||||
);
|
||||
const mcpTool1_b = new DiscoveredMCPTool(
|
||||
mockCallable,
|
||||
server1Name,
|
||||
`${server1Name}__banana-tool`,
|
||||
'banana-tool',
|
||||
'd3',
|
||||
{},
|
||||
'banana-tool',
|
||||
);
|
||||
|
||||
const mcpTool2 = new DiscoveredMCPTool(
|
||||
mockCallable,
|
||||
server2Name,
|
||||
'server2Name__tool-on-server2',
|
||||
'tool-on-server2',
|
||||
'd4',
|
||||
{},
|
||||
'tool-on-server2',
|
||||
);
|
||||
const nonMcpTool = new MockTool('regular-tool');
|
||||
|
||||
@@ -253,11 +249,7 @@ describe('ToolRegistry', () => {
|
||||
|
||||
// Assert that the array has the correct tools and is sorted by name
|
||||
expect(toolsFromServer1).toHaveLength(3);
|
||||
expect(toolNames).toEqual([
|
||||
`${server1Name}__apple-tool`,
|
||||
`${server1Name}__banana-tool`,
|
||||
`${server1Name}__zebra-tool`,
|
||||
]);
|
||||
expect(toolNames).toEqual(['apple-tool', 'banana-tool', 'zebra-tool']);
|
||||
|
||||
// Assert that all returned tools are indeed from the correct server
|
||||
for (const tool of toolsFromServer1) {
|
||||
|
||||
Reference in New Issue
Block a user