{"record":{"id":"ed1706dfe8903370","repo":"BerriAI/litellm","slug":"agent-agent-id-not-found","errorCode":null,"errorMessage":"Agent '{agent_id}' not found","messagePattern":"Agent '(.+?)' not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/agent_endpoints/a2a_endpoints.py","lineNumber":536,"sourceCode":"):\n    \"\"\"\n    Get the agent card for an agent (A2A discovery endpoint).\n\n    Supports both standard paths:\n    - /.well-known/agent-card.json\n    - /.well-known/agent.json\n\n    The URL in the agent card is rewritten to point to the LiteLLM proxy,\n    so all subsequent A2A calls go through LiteLLM for logging and cost tracking.\n    \"\"\"\n    from litellm.proxy.agent_endpoints.auth.agent_permission_handler import (\n        AgentRequestHandler,\n    )\n\n    try:\n        agent: Final = _get_agent(agent_id)\n        if agent is None:\n            raise HTTPException(status_code=404, detail=f\"Agent '{agent_id}' not found\")\n\n        # Check agent permission (skip for admin users)\n        is_allowed: Final = await AgentRequestHandler.is_agent_allowed(\n            agent_id=agent.agent_id,\n            user_api_key_auth=user_api_key_dict,\n        )\n        if not is_allowed:\n            raise HTTPException(\n                status_code=403,\n                detail=f\"Agent '{agent_id}' is not allowed for your key/team. Contact proxy admin for access.\",\n            )\n\n        if not agent.agent_card_params:\n            raise HTTPException(\n                status_code=404,\n                detail=f\"Agent '{agent_id}' has no agent card configured\",\n            )\n","sourceCodeStart":518,"sourceCodeEnd":554,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/agent_endpoints/a2a_endpoints.py#L518-L554","documentation":"Raised in the A2A agent-card discovery endpoint when _get_agent() returns None for the requested agent_id — no in-memory registry entry and no database row match. The endpoint returns HTTP 404 (inside a try block that converts it to a JSON-RPC-style error where appropriate), telling the client the agent identifier is unknown to this proxy.","triggerScenarios":"Thrown at litellm/proxy/agent_endpoints/a2a_endpoints.py:536 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the agent_id exists; list agents first."],"exampleFix":"GET /agents to find valid IDs.","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}