Class AgentUnavailableException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
A2AAgentCardException, McpToolResolutionException

public class AgentUnavailableException extends LangChain4jException
Thrown when an agent cannot be used because something it depends on is unavailable, typically the server of a remote agent, like an A2A or an MCP one, from which the agent card or the tool is fetched lazily, the first time it is needed: normally the first invocation of the agent, or the first request of its description when none is configured. It is the common type of these transient failures, whatever the integration they come from, as opposed to a configuration error like a tool that does not exist on its server, which is reported with its own exception. The supervisor leaves a subagent whose description fails with this exception out of the current invocation, with a warning, the HTML reports show its description as unavailable, and an error handler can recognize it in the cause chain of the AgentInvocationException it receives to skip the agent. The failure is not cached: the next invocation tries again.
Since:
1.24.0
See Also:
  • Constructor Details

    • AgentUnavailableException

      public AgentUnavailableException(String agentName, String message, Throwable cause)
  • Method Details

    • agentName

      public String agentName()
      Returns:
      the name of the unavailable agent
      Since:
      1.24.0