| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | |
| 6: | |
| 7: | |
| 8: | |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | |
| 14: | namespace Nexus\Mcp\Schema\Prompt; |
| 15: | |
| 16: | use Nexus\Mcp\Schema\BaseMetadata; |
| 17: | |
| 18: | |
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | |
| 25: | |
| 26: | |
| 27: | |
| 28: | final readonly class PromptArgument extends BaseMetadata |
| 29: | { |
| 30: | |
| 31: | |
| 32: | |
| 33: | |
| 34: | public function __construct( |
| 35: | string $name, |
| 36: | ?string $title = null, |
| 37: | public ?string $description = null, |
| 38: | public ?bool $required = null, |
| 39: | ) { |
| 40: | parent::__construct($name, $title); |
| 41: | } |
| 42: | |
| 43: | #[\Override] |
| 44: | public function toArray(): array |
| 45: | { |
| 46: | return array_filter([ |
| 47: | 'name' => $this->name, |
| 48: | 'title' => $this->title, |
| 49: | 'description' => $this->description, |
| 50: | 'required' => $this->required, |
| 51: | ], static fn(mixed $value): bool => null !== $value); |
| 52: | } |
| 53: | } |
| 54: | |