Time Module

Time management and task scheduling

Available Tools

  • time_now - Get current timestamp in multiple formats
  • time_sleep - Delay execution with configurable duration
  • time_schedule - In-memory task scheduler with create/cancel/list/status operations

Timestamp Formats

The time_now tool supports multiple timestamp formats:

  • Unix: Unix epoch timestamp
  • ISO8601: ISO 8601 format
  • RFC3339: RFC 3339 format
  • Custom: Custom format string

Example: Get Current Time

{
  "name": "time_now",
  "arguments": {
    "format": "ISO8601"
  }
}

Example: Schedule a Task

{
  "name": "time_schedule",
  "arguments": {
    "action": "create",
    "task_name": "backup",
    "delay_seconds": 3600,
    "command": "bash backup.sh"
  }
}

This creates an in-memory scheduled task that will execute after the specified delay.

Task Scheduler Operations

  • create: Create a new scheduled task
  • cancel: Cancel a scheduled task
  • list: List all scheduled tasks
  • status: Get status of a specific task

Example: Sleep/Delay

{
  "name": "time_sleep",
  "arguments": {
    "duration_seconds": 5
  }
}

Example: Custom Time Format

{
  "name": "time_now",
  "arguments": {
    "format": "custom",
    "custom_format": "%Y-%m-%d %H:%M:%S"
  }
}

Cancel Scheduled Task

{
  "name": "time_schedule",
  "arguments": {
    "action": "cancel",
    "task_name": "backup"
  }
}