const server = await api.mcp.get("example");
for (const tool of server.tools) {
console.log(tool.allowed ? "✓" : " ", tool.name, "—", tool.description);
}server = api.mcp.get("example")
for tool in server["tools"]:
print("✓" if tool["allowed"] else " ", tool["name"], "—", tool["description"])每个工具
namestring服务器呼叫它。
descriptionstring模型被告诉什么
inputSchemaobject其参数,正如服务器所声明的
allowedboolean是否被宣布为模式。
刷新重新读取服务器
const server = await api.mcp.get("example", { refresh: true });server = api.mcp.get("example", refresh=True)| 不再刷新 | 以刷新 | |
|---|---|---|
| 联系服务器 | 无 无 | 是——握手和工具列表 |
| 费用 | 无 | 往返 |
| 更新目录 | 无 无 | 是,以及商定的修订 |
| 您允许的列表 | 无变化 | 保留 |
刷新从不扩大允许的宽度
您允许的停留允许工具, 服务器添加的新工具不允许到达。 服务器不能通过运输更多工具而让自己拥有更多表面。
何时刷新
- 工具开始失败, 出现引力错误, 其计划可能已经改变 。
- 您想要允许的服务器已宣布新工具 。
lastError显示某物,你想知道它是否仍然真实。
信物又会回回给主人
get() 返回它,因为软件包需要它来联系服务器。它被加密在休息时,并且永远不会离开给其他人——这也是为什么它没有在 (列表).