'object', 'properties' => [ 'template' => [ 'type' => 'string', 'description' => 'Template name/slug', ], 'variables' => [ 'type' => 'object', 'description' => 'Variable values for the template', ], ], 'required' => ['template'], ]; } public function handle(array $args, array $context = []): array { try { $templateSlug = $this->require($args, 'template'); } catch (\InvalidArgumentException $e) { return $this->error($e->getMessage()); } $templateService = app(PlanTemplateService::class); $variables = $this->optional($args, 'variables', []); $preview = $templateService->previewTemplate($templateSlug, $variables); if (! $preview) { return $this->error("Template not found: {$templateSlug}"); } return [ 'template' => $templateSlug, 'preview' => $preview, ]; } }