Interface PreMcpToolCallHandler

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface PreMcpToolCallHandler
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 Details

    • handle

      Handles a pre-MCP-tool-call hook invocation.
      Parameters:
      input - the hook input containing server name, tool name, and arguments
      invocation - context information about the invocation
      Returns:
      a future that resolves with the hook output, or null to preserve existing metadata (no-op)