mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 02:51:14 +00:00
fix(MCP Client Tool Node): Stringify tool result (#14554)
This commit is contained in:
@@ -57,7 +57,7 @@ describe('McpClientTool', () => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
it('should return a valid toolkit with usable tools', async () => {
|
||||
it('should return a valid toolkit with usable tools (that returns a string)', async () => {
|
||||
jest.spyOn(Client.prototype, 'connect').mockResolvedValue();
|
||||
jest
|
||||
.spyOn(Client.prototype, 'callTool')
|
||||
@@ -93,7 +93,7 @@ describe('McpClientTool', () => {
|
||||
expect(tools).toHaveLength(2);
|
||||
|
||||
const toolCallResult = await tools[0].invoke({ input: 'foo' });
|
||||
expect(toolCallResult).toEqual([{ type: 'text', text: 'result from tool' }]);
|
||||
expect(toolCallResult).toEqual(JSON.stringify([{ type: 'text', text: 'result from tool' }]));
|
||||
});
|
||||
|
||||
it('should support selecting tools to expose', async () => {
|
||||
|
||||
Reference in New Issue
Block a user