DateResolverTool

class DateResolverTool(clock: Clock = Clock.System, timeZone: TimeZone = TimeZone.currentSystemDefault()) : LlmTool

Resolves a small vocabulary of relative date expressions to absolute ISO-8601 dates.

Supported expressions (case-insensitive, surrounding whitespace ignored):

  • today, tomorrow, yesterday

  • in N days|weeks|months|years

  • N days|weeks|months|years ago

  • next monday ... next sunday, last monday ... last sunday

  • Any literal ISO-8601 date (YYYY-MM-DD) passes through unchanged.

Unrecognised input resolves to the reference date and is reported back via the summary field so the LLM can react. This is intentionally a minimal, dependency-free parser — Phase 1 trades natural-language coverage for multiplatform purity. Apps that need richer parsing can swap in their own tool implementation.

Constructors

Link copied to clipboard
constructor(clock: Clock = Clock.System, timeZone: TimeZone = TimeZone.currentSystemDefault())

Properties

Link copied to clipboard
Link copied to clipboard
open override val descriptor: ToolDescriptor
Link copied to clipboard
open val name: String

Functions

Link copied to clipboard
open suspend override fun execute(arguments: JsonObject): String
Link copied to clipboard
open fun matches(toolName: String): Boolean