fix(mcp): rewrite hallucinated `tools/call` argument names (#2598)
Some LLM clients send `context7CompatibleLibraryID`/`userQuery` instead of the canonical `libraryId`/`query` — likely echoing phrasing from the tool descriptions — and trip Zod validation before the tool ever runs. Hook `Transport.onmessage` (set before `server.connect()` so the SDK chains its dispatch over it) and rewrite those two keys in place on `tools/call` requests where the canonical key is absent. Published `tools/list` schemas are unchanged; the rewrite is a server-side compatibility shim.
F
Fahreddin Özcan committed
187287c690a436f94c8e214c4206134d0e6c13be
Parent: 78b9826
Committed by GitHub <noreply@github.com>
on 5/11/2026, 5:50:36 PM