MCPcopy Index your code
hub / github.com/modelcontextprotocol/python-sdk / fail

Function fail

tests/server/test_streamable_http_modern.py:238–239  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

236 `JSONRPCError` whose `error` carries the same code, message, and data."""
237
238 async def fail() -> dict[str, Any]:
239 raise MCPError(code=METHOD_NOT_FOUND, message="nope", data="x")
240
241 reply = await _to_jsonrpc_response("rid", fail())
242 assert isinstance(reply, JSONRPCError)

Calls 1

MCPErrorClass · 0.90

Tested by

no test coverage detected