Module

_jsonrpc

Shared JSON-RPC output helpers for mcp.py and gateway.py.

Functions

_parse_request 1 tuple[Any, str, dict[str…
Parse and validate one JSON-RPC request line. Returns ``(id, method, params, i…
def _parse_request(line: str) -> tuple[Any, str, dict[str, Any], bool] | None

Parse and validate one JSON-RPC request line.

Returns(id, method, params, is_notification) or Noneafter writing a JSON-RPC error response for malformed input.

Parameters
Name Type Description
line str
Returns
tuple[Any, str, dict[str, Any], bool] | None
_write_notification 2 None
Write a JSON-RPC notification (no id field, no response expected).
def _write_notification(method: str, params: dict[str, Any]) -> None
Parameters
Name Type Description
method str
params dict[str, Any]