eino icon indicating copy to clipboard operation
eino copied to clipboard

call mcp tool fail

Open dahaogewsh opened this issue 8 months ago • 3 comments

请问这个报错能在graph里面接住吗?我不想因为这个把我的graph停了

dahaogewsh avatar Apr 18 '25 06:04 dahaogewsh

stream error: default implementation: 'StreamByTransform' got error, when try to call internal action, err: failed to wait for tasks: execute node[tools] fail: default implementation: 'TransformByStream' got error, when try to call internal action, err: failed to stream tool call call_v9mxs7bt73ndh1n6cs17efpm: default implementation: 'StreamByInvoke' got error, when try to call internal action, err: call mcp tool fail: {"content":[{"type":"text","text":"browser.newPage: Target page, context or browser has been closed"}],"isError":true} exit status 1 这是完整报错

dahaogewsh avatar Apr 18 '25 06:04 dahaogewsh

你这里的场景是,当 ToolsNode 执行一个 Tool 时,如果这个 Tool 报错了,希望把这个 error 转换成一个正常的输出内容?

如果是这样的话, 推荐给 InvokableTool 增加一个装饰层,也就是基于 InvokableTool 的接口定义,把指定的 Tool 再包一层实现,这个实现中处理和转换 error

hi-pender avatar Apr 25 '25 05:04 hi-pender

可以用https://github.com/cloudwego/eino/blob/cef5624bf1dcb3d04edac89c66fe271fe39a1493/components/tool/utils/error_handler.go#L40 这个工具

meguminnnnnnnnn avatar Apr 25 '25 07:04 meguminnnnnnnnn