Interface McpClientListener
public interface McpClientListener
Listener interface for monitoring MCP client operations.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidafterExecuteTool(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).default voidafterPromptGet(McpCallContext context, McpGetPromptResult result, Map<String, Object> rawResult) Called after getting a prompt.default voidafterResourceGet(McpCallContext context, McpReadResourceResult result, Map<String, Object> rawResult) Called after getting a resource.default voidbeforeExecuteTool(McpCallContext context) Called before executing a tool.default voidbeforePromptGet(McpCallContext context) Called before getting a prompt.default voidbeforeResourceGet(McpCallContext context) Called before getting a resource.default voidonExecuteToolError(McpCallContext context, Throwable error) Called when a tool execution fails due to a protocol-level or communication error.default voidonPromptGetError(McpCallContext context, Throwable error) Called when getting a prompt fails.default voidonResourceGetError(McpCallContext context, Throwable error) Called when getting a resource fails.
-
Method Details
-
beforeExecuteTool
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
Called when a tool execution fails due to a protocol-level or communication error. -
beforeResourceGet
Called before getting a resource. -
afterResourceGet
default void afterResourceGet(McpCallContext context, McpReadResourceResult result, Map<String, Object> rawResult) Called after getting a resource. -
onResourceGetError
Called when getting a resource fails. -
beforePromptGet
Called before getting a prompt. -
afterPromptGet
default void afterPromptGet(McpCallContext context, McpGetPromptResult result, Map<String, Object> rawResult) Called after getting a prompt. -
onPromptGetError
Called when getting a prompt fails.
-