Part of #5743 (Workstream B: 2025-11-25 compliance).
Gap
When the tool-call gating middleware blocks a filtered tool, it returns HTTP 400 instead of a JSON-RPC error response (pkg/mcp/tool_filter.go, acknowledged in a code comment). MCP clients expect protocol-level errors for protocol-level problems; a transport 400 breaks client error handling and shows up as a connection problem rather than "tool not found".
Proposed work
Return a proper JSON-RPC error (method the spec uses for unknown tools — invalid params / tool not found semantics) over the negotiated response mode (JSON or SSE), keeping HTTP 400 only for genuinely malformed HTTP/JSON.
Priority: Low.
Part of #5743 (Workstream B: 2025-11-25 compliance).
Gap
When the tool-call gating middleware blocks a filtered tool, it returns HTTP 400 instead of a JSON-RPC error response (
pkg/mcp/tool_filter.go, acknowledged in a code comment). MCP clients expect protocol-level errors for protocol-level problems; a transport 400 breaks client error handling and shows up as a connection problem rather than "tool not found".Proposed work
Return a proper JSON-RPC error (method the spec uses for unknown tools — invalid params / tool not found semantics) over the negotiated response mode (JSON or SSE), keeping HTTP 400 only for genuinely malformed HTTP/JSON.
Priority: Low.