*/ public function parameters(): array { return [ 'type' => 'object', 'properties' => [ 'format' => [ 'type' => 'string', 'description' => '可选的日期格式,默认为 RFC3339。', ], ], 'required' => [], ]; } /** * @param array $arguments * @return array */ public function execute(array $arguments): array { $format = is_string($arguments['format'] ?? null) && $arguments['format'] !== '' ? $arguments['format'] : Carbon::RFC3339_EXTENDED; return [ 'now' => Carbon::now()->format($format), ]; } }