rohitg00/ai-engineering-from-scratch · error · RpcError
-32602
-32602
Error message
Missing request metadata
What it means
Error "Missing request metadata" thrown in rohitg00/ai-engineering-from-scratch.
Source
Thrown at phases/13-tools-and-protocols/10-mcp-resources-and-prompts/code/main.py:85
return {
"io.modelcontextprotocol/protocolVersion": PROTOCOL_VERSION,
"io.modelcontextprotocol/clientInfo": {"name": client_name, "version": "1.0.0"},
"io.modelcontextprotocol/clientCapabilities": {},
}
def response_meta() -> dict[str, Any]:
return {"io.modelcontextprotocol/serverInfo": SERVER_INFO.copy()}
def complete(**payload: Any) -> dict[str, Any]:
return {"resultType": "complete", **payload, "_meta": response_meta()}
def validate_request_meta(params: dict[str, Any]) -> None:
meta = params.get("_meta")
if not isinstance(meta, dict):
raise RpcError(-32602, "Missing request metadata")
requested = meta.get("io.modelcontextprotocol/protocolVersion")
if not isinstance(requested, str):
raise RpcError(-32602, "Missing or invalid protocol version")
if requested != PROTOCOL_VERSION:
raise RpcError(
-32022,
"Unsupported protocol version",
{"supported": [PROTOCOL_VERSION], "requested": requested},
)
if not isinstance(meta.get("io.modelcontextprotocol/clientCapabilities"), dict):
raise RpcError(-32602, "Missing client capabilities")
def server_discover(_: dict[str, Any]) -> dict[str, Any]:
return complete(
supportedVersions=[PROTOCOL_VERSION],
capabilities={
"resources": {"listChanged": True, "subscribe": True},View on GitHub (pinned to 39ea8a1c6d)
When it happens
Trigger: Thrown at phases/13-tools-and-protocols/10-mcp-resources-and-prompts/code/main.py:85 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of rohitg00/ai-engineering-from-scratch@39ea8a1c6d (2026-08-26).
Data as JSON: /api/errors/c1059354ef70e88e.
Report an issue: GitHub.