time.go
package tools
import (
"context"
"time"
)
// GetCurrentTimeInput defines the input parameters for the get_current_time tool
type GetCurrentTimeInput struct {
// No input parameters needed for basic time query
}
// GetCurrentTimeOutput defines the output structure for the get_current_time tool
type GetCurrentTimeOutput struct {
Time string `json:"time"`
Timezone string `json:"timezone"`
Unix int64 `json:"unix"`
}
// GetCurrentTime returns current system time with timezone and Unix timestamp
func GetCurrentTime(ctx context.Context, input GetCurrentTimeInput) (GetCurrentTimeOutput, error) {
now := time.Now()
output := GetCurrentTimeOutput{
Time: now.Format(time.RFC3339),
Timezone: now.Location().String(),
Unix: now.Unix(),
}
return output, nil
}