{"record":{"id":"5cb8358b2c386b87","repo":"rohitg00/ai-engineering-from-scratch","slug":"32022-5cb835","errorCode":"-32022","errorMessage":"Unsupported protocol version","messagePattern":"Unsupported protocol version","errorType":"exception","errorClass":"RpcError","httpStatus":null,"severity":"error","filePath":"phases/13-tools-and-protocols/10-mcp-resources-and-prompts/code/main.py","lineNumber":90,"sourceCode":"\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},\n            \"prompts\": {\"listChanged\": True},\n        },\n        instructions=\"Read notes by URI and let users select review prompts.\",\n        ttlMs=3_600_000,\n        cacheScope=\"public\",","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/rohitg00/ai-engineering-from-scratch/blob/39ea8a1c6d0b61f071226eff7ede4d4105fed820/phases/13-tools-and-protocols/10-mcp-resources-and-prompts/code/main.py#L72-L108","documentation":"Error \"Unsupported protocol version\" thrown in rohitg00/ai-engineering-from-scratch.","triggerScenarios":"Thrown at phases/13-tools-and-protocols/10-mcp-resources-and-prompts/code/main.py:90 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"}