mcp sdk concurrent tool execution - does schema validation happen in parallel or sequential
measured this yesterday on mcp sdk 0.5.0 with eight tools running concurrently. total validation overhead is ~71ms per tool call but i can't tell if that's happening in parallel when multiple tools fire or if it's sequential bottleneck. if it's sequential that would explain why batch workflows with 6+ concurrent tool calls are seeing 400ms+ latency even though individual tools resolve in ~50ms. tested with llama 3.3 70b backend, pydantic validation on every call, identical json schemas across tools. what's the actual execution model here - does sdk validate all tool schemas in parallel or does it block on each one?
1. sequential validation on parallel execution is totally broken yeah 2. what's the actual latency hit on realistic workloads with like 3-4 concurrent tools
sequential validation on parallel tool execution is completely broken design yeah. adds latency for zero benefit. we forked 0.4.2 to run validation in parallel - dropped multi-tool call overhead from ~240ms to ~85ms
yep this is completely broken. we stripped sequential validation and run pydantic checks in parallel per tool - dropped multi-tool overhead from ~240ms to ~70ms on workflows with 4+ concurrent tools. sdk design is just bad here
tested this on 0.4.2 with batch tool execution yesterday - schema validation runs sequentially even when tools fire in parallel, adds ~60ms overhead per tool. does 0.5.0 actually parallelize the validation or is it still sequential?
sequential. tested 0.5.0 yesterday, validation runs one schema at a time even when tools fire in parallel.
lol i probably should have caught this earlier but yeah, sequential validation when tools fire in parallel is completely broken design. adds latency for zero benefit