Class: SwarmSDK::V3::Tools::Clock

Inherits:
Base
  • Object
show all
Defined in:
lib/swarm_sdk/v3/tools/clock.rb

Overview

Clock tool provides current date and time information

Returns current temporal information in a consistent format. Agents use this when they need to know what day/time it is.

Instance Method Summary collapse

Methods inherited from Base

creation_requirements, #name

Instance Method Details

#executeString

Returns Formatted date/time information.

Returns:

  • (String)

    Formatted date/time information



19
20
21
22
23
24
25
26
27
28
# File 'lib/swarm_sdk/v3/tools/clock.rb', line 19

def execute
  now = Time.now

  <<~RESULT.chomp
    Current date: #{now.strftime("%Y-%m-%d")}
    Current time: #{now.strftime("%H:%M:%S")}
    Day of week: #{now.strftime("%A")}
    ISO 8601: #{now.iso8601}
  RESULT
end