Interface Cancellation


public interface Cancellation
Interface for determining if an MCP client requested cancellation of an in-progress request.

Tool, Prompt, Resource, and ResourceTemplate methods can accept this interface as a parameter. It will be automatically injected by the framework implementation before the method is invoked.

See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Exception indicating that an MCP request cannot be completed because it was cancelled by the client.
    static interface 
    Result of a cancellation check.
  • Method Summary

    Modifier and Type
    Method
    Description
    Perform the cancellation check.
    default void
    Perform the check and if cancellation is requested then skip the processing.