获取 API 密钥
麦克读器用量

发现 □ 被拒绝的工具

握手者对服务器学到了什么,以及服务器的哪些工具不能申报——命名,而不是悄悄地放下。

read after initializerejections are namedinvalid definitions
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

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))