{"record":{"id":"c1059354ef70e88e","repo":"rohitg00/ai-engineering-from-scratch","slug":"32602-c10593","errorCode":"-32602","errorMessage":"Missing request metadata","messagePattern":"Missing request metadata","errorType":"exception","errorClass":"RpcError","httpStatus":null,"severity":"error","filePath":"phases/13-tools-and-protocols/10-mcp-resources-and-prompts/code/main.py","lineNumber":85,"sourceCode":"    return {\n        \"io.modelcontextprotocol/protocolVersion\": PROTOCOL_VERSION,\n        \"io.modelcontextprotocol/clientInfo\": {\"name\": client_name, \"version\": \"1.0.0\"},\n        \"io.modelcontextprotocol/clientCapabilities\": {},\n    }\n\n\ndef response_meta() -> dict[str, Any]:\n    return {\"io.modelcontextprotocol/serverInfo\": SERVER_INFO.copy()}\n\n\ndef complete(**payload: Any) -> dict[str, Any]:\n    return {\"resultType\": \"complete\", **payload, \"_meta\": response_meta()}\n\n\ndef validate_request_meta(params: dict[str, Any]) -> None:\n    meta = params.get(\"_meta\")\n    if not isinstance(meta, dict):\n        raise RpcError(-32602, \"Missing request metadata\")\n    requested = meta.get(\"io.modelcontextprotocol/protocolVersion\")\n    if not isinstance(requested, str):\n        raise RpcError(-32602, \"Missing or invalid protocol version\")\n    if requested != PROTOCOL_VERSION:\n        raise RpcError(\n            -32022,\n            \"Unsupported protocol version\",\n            {\"supported\": [PROTOCOL_VERSION], \"requested\": requested},\n        )\n    if not isinstance(meta.get(\"io.modelcontextprotocol/clientCapabilities\"), dict):\n        raise RpcError(-32602, \"Missing client capabilities\")\n\n\ndef server_discover(_: dict[str, Any]) -> dict[str, Any]:\n    return complete(\n        supportedVersions=[PROTOCOL_VERSION],\n        capabilities={\n            \"resources\": {\"listChanged\": True, \"subscribe\": True},","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/rohitg00/ai-engineering-from-scratch/blob/39ea8a1c6d0b61f071226eff7ede4d4105fed820/phases/13-tools-and-protocols/10-mcp-resources-and-prompts/code/main.py#L67-L103","documentation":"Error \"Missing request metadata\" thrown in rohitg00/ai-engineering-from-scratch.","triggerScenarios":"Thrown at phases/13-tools-and-protocols/10-mcp-resources-and-prompts/code/main.py:85 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"39ea8a1c6d0b61f071226eff7ede4d4105fed820","analyzedAt":"2026-08-26T03:13:46.626Z","schemaVersion":2},"datasetVersion":"2026-08-26T07:17:17.940Z"}