await client.initialize();
const tools = await client.listTools();
console.log(client.protocolVersion); // the revision both sides agreed on
console.log(client.rejectedTools); // [{ name, reason }]client.initialize()
tools = client.list_tools()
print(client.protocol_version) # the revision both sides agreed on为何拒绝使用工具
| 原因原因原因原因原因原因原因 | 含义 |
|---|---|
| 无法使用的名称 | 任何事物都不能幸存于前置和修剪。 |
| 无法读取的页头注释 | 它处于一种可以分解的结构之下,因此在论点中没有一条可阅读的单一路径——该说明称这样一个定义无效。 |
已经命名拒绝的工具, 而不是隐藏
静静地丢下它会留下服务器自己的文件, 保证一个从未出现的工具, 没有任何线索。 原因是发送给操作服务器的人。
协议协议协议
客户并不喜欢这个客户所喜欢的,服务器所喜欢的不是这个客户所喜欢的,服务器所喜欢的不是——这两个人都知道的。它记录在连接上,可见于 (列表).
冲着它
if (client.rejectedTools.length) {
console.warn("not declarable:", client.rejectedTools.map((t) => `${t.name} (${t.reason})`).join(", "));
}# The Python client returns every tool the server lists; check each schema yourself
from iagenify import sanitize_schema
declarable = [t for t in tools if sanitize_schema(t.get("inputSchema") or {}).get("type") == "object"]
skipped = [t["name"] for t in tools if t not in declarable]
if skipped:
print("not declarable:", ", ".join(skipped))