Interface ToolHandler.Cancellable

All Superinterfaces:
ToolHandler
Enclosing interface:
ToolHandler
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 static interface ToolHandler.Cancellable extends ToolHandler
A handler that observes its cancellation signal while it runs. Implement it with a three-argument lambda; calling the two-argument form runs it with a never-cancelled signal.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface ToolHandler

    ToolHandler.Cancellable
    Modifier and Type
    Interface
    Description
    static interface 
    A handler that observes its cancellation signal while it runs.
  • Method Summary

    Modifier and Type
    Method
    Description
    default com.fasterxml.jackson.databind.node.ObjectNode
    handle(com.fasterxml.jackson.databind.JsonNode arguments, ServerContext context)
    Runs the handler with a never-cancelled signal (direct invocations and tests).
    com.fasterxml.jackson.databind.node.ObjectNode
    handle(com.fasterxml.jackson.databind.JsonNode arguments, ServerContext context, CancellationSignal cancellation)
    Executes the tool, checking cancellation at each point where stopping is still safe.
  • Method Details

    • handle

      com.fasterxml.jackson.databind.node.ObjectNode handle(com.fasterxml.jackson.databind.JsonNode arguments, ServerContext context, CancellationSignal cancellation) throws Exception
      Executes the tool, checking cancellation at each point where stopping is still safe.
      Specified by:
      handle in interface ToolHandler
      Parameters:
      arguments - the parsed tool-call arguments
      context - the shared server context
      cancellation - the call's cancellation signal
      Returns:
      the structured result payload
      Throws:
      Exception - on any failure
    • handle

      default com.fasterxml.jackson.databind.node.ObjectNode handle(com.fasterxml.jackson.databind.JsonNode arguments, ServerContext context) throws Exception
      Runs the handler with a never-cancelled signal (direct invocations and tests).
      Specified by:
      handle in interface ToolHandler
      Parameters:
      arguments - the parsed tool-call arguments
      context - the shared server context
      Returns:
      the structured result payload
      Throws:
      Exception - on any failure