You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
when calling a asyn method in tool callbak, always raise an error "No connection established for request ID".
this error will be catched internal, makes tool call looks like pending.
To Reproduce
Steps to reproduce the behavior:
register a echo tool like following:
server.registerTool(
'echo',
{
title: 'Echo Tool',
description: 'Echoes back the provided message',
inputSchema: { message: z.string() }
},
async ({ message }) => {
logger.info(Echo tool called with message: ${message});
// await aync call will cause the response return immediately
await new Promise(resolve => {
setTimeout(resolve, 1)
})
// when returning from this, the reported error will be raised
return {
content: [{ type: 'text', text: `Tool echo: ${message}` }]
};
}
);
Expected behavior
async call in a tool should be allowed.