Class McpToolResolutionException

All Implemented Interfaces:
Serializable

public class McpToolResolutionException extends AgentUnavailableException
Thrown when the MCP tool wrapped by an MCP client agent cannot be resolved, because the MCP client cannot be created or the tools of the MCP server cannot be listed. The tool is resolved lazily, the first time it is needed, which is normally the first invocation of the agent, so this exception reaches the caller of that invocation and the error handler of the agentic system, where it can be recognized to skip an agent whose MCP server is unavailable, by this type or by its supertype AgentUnavailableException, common to every integration. A resolution that does not complete within the resolution timeout of the agent, when one is set, is interrupted and reported with this exception too, with a TimeoutException as cause. As long as a resolution that timed out has not reacted to its interruption, the tool cannot be resolved again: the invocations arriving in the meantime fail at once, with a message saying that the previous resolution is still running. Concurrent first invocations wait on the same resolution and all fail when it fails, each with its own exception sharing that cause, but a failed resolution is not cached: the next invocation retries it. A retry from the error handler happens at once, so it should be bounded by the handler itself. A tool that is not found on the server, or a missing tool name when the server exposes several tools, is a configuration error instead, reported with an AgenticSystemConfigurationException.
Since:
1.24.0
See Also:
  • Constructor Details

    • McpToolResolutionException

      public McpToolResolutionException(String agentName, String toolName, Throwable cause)
  • Method Details

    • toolName

      public String toolName()
      Returns:
      the name of the tool configured for the agent, or null when the agent binds the single tool of its MCP server
      Since:
      1.24.0