Record Class TasksConfig

java.lang.Object
java.lang.Record
dev.tachyonmcp.core.server.config.TasksConfig
Record Components:
enabled - whether the tasks capability is advertised at all (default false); the capability is also advertised, regardless of this flag, when a registered tool supports task augmentation
list - whether tasks/list is exposed (default false)
cancel - whether tasks/cancel is supported (default false)
requests - whether task-augmented tools/call requests are accepted (default false)
pageSize - default page size when a list request omits its limit
keepAlive - default retention window for a terminal task's result before it's dropped from memory (default 5 minutes); overridable per task via TaskOptions.keepAlive()
pollInterval - default pollInterval suggested to requestors in task responses, or null (the default) to suggest none; overridable per task via TaskOptions.pollInterval(). Unlike keepAlive, this value is wire-visible and spec-compliant requestors SHOULD throttle their own polling cadence to match it — pick a value that fits how long tasks in this server actually run, there's no one-size-fits-all default.

public record TasksConfig(boolean enabled, boolean list, boolean cancel, boolean requests, int pageSize, Duration keepAlive, @Nullable Duration pollInterval) extends Record
Configuration for the tasks capability. Fields map 1:1 to the MCP tasks capability object (tasks.list, tasks.cancel, tasks.requests.tools.call).
  • Field Details

    • DEFAULT_TASK_KEEP_ALIVE

      public static final Duration DEFAULT_TASK_KEEP_ALIVE
      Public (unlike the defaults above) — TaskEntry in a different package reuses this as the resolved default.
  • Constructor Details

    • TasksConfig

      public TasksConfig(boolean enabled, boolean list, boolean cancel, boolean requests, int pageSize, Duration keepAlive, @Nullable Duration pollInterval)
      Creates an instance of a TasksConfig record class.
      Parameters:
      enabled - the value for the enabled record component
      list - the value for the list record component
      cancel - the value for the cancel record component
      requests - the value for the requests record component
      pageSize - the value for the pageSize record component
      keepAlive - the value for the keepAlive record component
      pollInterval - the value for the pollInterval record component
  • Method Details

    • builder

      public static TasksConfig.Builder builder()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • enabled

      public boolean enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component
    • list

      public boolean list()
      Returns the value of the list record component.
      Returns:
      the value of the list record component
    • cancel

      public boolean cancel()
      Returns the value of the cancel record component.
      Returns:
      the value of the cancel record component
    • requests

      public boolean requests()
      Returns the value of the requests record component.
      Returns:
      the value of the requests record component
    • pageSize

      public int pageSize()
      Returns the value of the pageSize record component.
      Returns:
      the value of the pageSize record component
    • keepAlive

      public Duration keepAlive()
      Returns the value of the keepAlive record component.
      Returns:
      the value of the keepAlive record component
    • pollInterval

      public @Nullable Duration pollInterval()
      Returns the value of the pollInterval record component.
      Returns:
      the value of the pollInterval record component