Class McpToolCallExecutionException

Object
Throwable
Exception
RuntimeException
akka.javasdk.agent.McpToolCallExecutionException
All Implemented Interfaces:
Serializable

public final class McpToolCallExecutionException extends RuntimeException
Exception thrown when an MCP (Model Context Protocol) tool call fails during execution.

This exception is thrown by agents when they attempt to call MCP tools from remote servers and the tool execution fails. It provides detailed information about which tool and endpoint failed to help with debugging and error handling.

Context Information: The exception includes the tool name and endpoint URL to help identify the source of the failure. This is particularly useful when agents are using multiple MCP servers or when debugging tool integration issues.

Error Handling: Agents can catch this exception in their onFailure handlers to provide fallback behavior or alternative responses when MCP tools are unavailable.

See Also:
  • Constructor Details

    • McpToolCallExecutionException

      public McpToolCallExecutionException(String message, String toolName, String endpoint, Throwable cause)
  • Method Details

    • getToolName

      public String getToolName()
      Returns the name of the MCP tool that failed to execute.
      Returns:
      the tool name
    • getEndpoint

      public String getEndpoint()
      Returns the MCP endpoint where the failure occurred.
      Returns:
      the endpoint