- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Handler for pre-MCP-tool-call hooks.
This hook is called before an MCP tool call is dispatched to an MCP server, allowing you to:
- Inspect the tool call arguments and server name
- Set, replace, or remove MCP request metadata (
_meta)
- Since:
- 1.0.8
-
Method Summary
Modifier and TypeMethodDescriptionhandle(PreMcpToolCallHookInput input, HookInvocation invocation) Handles a pre-MCP-tool-call hook invocation.
-
Method Details
-
handle
CompletableFuture<PreMcpToolCallHookOutput> handle(PreMcpToolCallHookInput input, HookInvocation invocation) Handles a pre-MCP-tool-call hook invocation.- Parameters:
input- the hook input containing server name, tool name, and argumentsinvocation- context information about the invocation- Returns:
- a future that resolves with the hook output, or
nullto preserve existing metadata (no-op)
-