Get an API key
McpClient

discovered · rejectedTools

What the handshake learned about the server, and which of its tools could not be declared — named, rather than quietly dropped.

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

Why a tool is rejected

ReasonMeans
An unusable nameNothing survives the prefixing and trimming.
A header annotation that cannot be readIt sits under a construct that could branch, so there is no single path to read in the arguments — the specification calls such a definition invalid.
A rejected tool is named, not hidden

Dropping it in silence would leave a server's own documentation promising a tool that never appears, with nothing to point at. The reason is the thing to send to whoever operates the server.

protocolVersion is the agreed one

Not what this client prefers and not what the server prefers — what both know. It is recorded on a connection, and visible in list().

Surfacing it

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