What problem does this feature solve
参考 MCP示例,编写一个工具返回结构化数据:
server.registerTool(
'add-one',
{
title: '计算小学数学加法',
description: '计算小学数学加法时调用',
inputSchema: { n: z.number() },
outputSchema: {
type: 'object',
properties: {
n: { type: 'number', description: '输入的数字' },
add1: { type: 'number', description: '输入数字+1之后的值' }
},
required: ['n', 'add1']
}
},
async ({ n }) => {
const ret = {
n: n,
add1: n + 1
}
return {
content: [{ type: 'text', text: JSON.stringify(ret) }],
structuredContent: ret
}
}
)
当 使用 AI-EXT插件访问时, 工具调用成功,但是ai-sdk的流消息中打印:
当使用remoter 连接远程的网页时,工具调用失败:
远程网页的网络面板中:
综上, 本地调用 或 经过web-agent后台调用,都会有异常
What does the proposed API look like
期望 agent不报错
What is your project name
no
What problem does this feature solve
参考 MCP示例,编写一个工具返回结构化数据:
当 使用 AI-EXT插件访问时, 工具调用成功,但是ai-sdk的流消息中打印:
当使用remoter 连接远程的网页时,工具调用失败:
远程网页的网络面板中:
综上, 本地调用 或 经过web-agent后台调用,都会有异常
What does the proposed API look like
期望 agent不报错
What is your project name
no