{"record":{"id":"0ea2cd961465451c","repo":"rohitg00/ai-engineering-from-scratch","slug":"32601-0ea2cd","errorCode":"-32601","errorMessage":"Method not found: {message['method']}","messagePattern":"Method not found: (.+?)","errorType":"error_code","errorClass":"RpcProblem","httpStatus":null,"severity":"error","filePath":"phases/13-tools-and-protocols/07-building-an-mcp-server/code/main.py","lineNumber":350,"sourceCode":"    \"prompts/list\": handle_prompts_list,\n    \"resources/list\": handle_resources_list,\n    \"resources/read\": handle_resources_read,\n    \"server/discover\": handle_discover,\n    \"tools/call\": handle_tools_call,\n    \"tools/list\": handle_tools_list,\n}\n\n\ndef dispatch(message: dict[str, Any]) -> dict[str, Any] | None:\n    if \"id\" not in message:\n        return None\n    request_id = message.get(\"id\")\n    error_id = request_id if type(request_id) in (int, str) else None\n    try:\n        validate_request(message)\n        handler = HANDLERS.get(message[\"method\"])\n        if handler is None:\n            raise RpcProblem(-32601, f\"Method not found: {message['method']}\")\n        result = handler(message[\"params\"])\n        return {\"jsonrpc\": \"2.0\", \"id\": request_id, \"result\": result}\n    except RpcProblem as exc:\n        return rpc_error(error_id, exc.code, str(exc), exc.data)\n    except Exception as exc:\n        return rpc_error(error_id, -32603, \"Internal error\", {\"detail\": str(exc)})\n\n\ndef serve_stdio() -> None:\n    for raw_line in sys.stdin:\n        line = raw_line.strip()\n        if not line:\n            continue\n        try:\n            parsed = json.loads(line)\n        except json.JSONDecodeError as exc:\n            response = rpc_error(None, -32700, \"Parse error\", {\"detail\": str(exc)})\n        else:","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/rohitg00/ai-engineering-from-scratch/blob/39ea8a1c6d0b61f071226eff7ede4d4105fed820/phases/13-tools-and-protocols/07-building-an-mcp-server/code/main.py#L332-L368","documentation":"Error \"Method not found: {message['method']}\" thrown in rohitg00/ai-engineering-from-scratch.","triggerScenarios":"Thrown at phases/13-tools-and-protocols/07-building-an-mcp-server/code/main.py:350 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"}