Interface McpClientListener


public interface McpClientListener
Listener interface for monitoring MCP client operations.
  • Method Details

    • beforeExecuteTool

      default void beforeExecuteTool(McpCallContext context)
      Called before executing a tool.
    • afterExecuteTool

      default void afterExecuteTool(McpCallContext context, ToolExecutionResult result, Map<String,Object> rawResult)
      Called after executing a tool if the execution was successful, or if it resulted in an application-level error (but not a protocol-level or communication error).
    • onExecuteToolError

      default void onExecuteToolError(McpCallContext context, Throwable error)
      Called when a tool execution fails due to a protocol-level or communication error.
    • beforeResourceGet

      default void beforeResourceGet(McpCallContext context)
      Called before getting a resource.
    • afterResourceGet

      default void afterResourceGet(McpCallContext context, McpReadResourceResult result, Map<String,Object> rawResult)
      Called after getting a resource.
    • onResourceGetError

      default void onResourceGetError(McpCallContext context, Throwable error)
      Called when getting a resource fails.
    • beforePromptGet

      default void beforePromptGet(McpCallContext context)
      Called before getting a prompt.
    • afterPromptGet

      default void afterPromptGet(McpCallContext context, McpGetPromptResult result, Map<String,Object> rawResult)
      Called after getting a prompt.
    • onPromptGetError

      default void onPromptGetError(McpCallContext context, Throwable error)
      Called when getting a prompt fails.