{"record":{"id":"a6bf9712e751bb59","repo":"rohitg00/ai-engineering-from-scratch","slug":"32601-a6bf97","errorCode":"-32601","errorMessage":"Method not found: {method}","messagePattern":"Method not found: (.+?)","errorType":"exception","errorClass":"RpcFault","httpStatus":null,"severity":"error","filePath":"phases/13-tools-and-protocols/09-mcp-transports/code/main.py","lineNumber":290,"sourceCode":"        elif method == \"tools/call\":\n            if params.get(\"name\") != \"ping\" or not isinstance(params.get(\"arguments\", {}), dict):\n                result = complete(\n                    {\n                        \"content\": [{\"type\": \"text\", \"text\": \"Unknown or invalid tool\"}],\n                        \"isError\": True,\n                    }\n                )\n            else:\n                result = complete(\n                    {\"content\": [{\"type\": \"text\", \"text\": \"pong\"}], \"isError\": False}\n                )\n        elif method == \"subscriptions/listen\":\n            notifications = params.get(\"notifications\")\n            if not isinstance(notifications, dict):\n                raise RpcFault(-32602, \"subscriptions/listen requires notifications\")\n            result = complete({})\n        else:\n            raise RpcFault(-32601, f\"Method not found: {method}\")\n        return {\"jsonrpc\": \"2.0\", \"id\": request_id, \"result\": result}\n    except RpcFault as exc:\n        return rpc_error(request_id, exc.code, str(exc), exc.data)\n\n\ndef accepted_filter(requested: dict[str, Any]) -> dict[str, Any]:\n    accepted: dict[str, Any] = {}\n    for key in (\"toolsListChanged\", \"promptsListChanged\", \"resourcesListChanged\"):\n        if requested.get(key) is True:\n            accepted[key] = True\n    resources = requested.get(\"resourceSubscriptions\")\n    if isinstance(resources, list) and all(isinstance(uri, str) for uri in resources):\n        accepted[\"resourceSubscriptions\"] = resources.copy()\n    return accepted\n\n\ndef subscription_messages(message: dict[str, Any]) -> list[dict[str, Any]]:\n    request_id = message[\"id\"]","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/rohitg00/ai-engineering-from-scratch/blob/39ea8a1c6d0b61f071226eff7ede4d4105fed820/phases/13-tools-and-protocols/09-mcp-transports/code/main.py#L272-L308","documentation":"Error \"Method not found: {method}\" thrown in rohitg00/ai-engineering-from-scratch.","triggerScenarios":"Thrown at phases/13-tools-and-protocols/09-mcp-transports/code/main.py:290 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"}