|
14 | 14 | use Symfony\Component\Console\Output\OutputInterface; |
15 | 15 | use Symfony\Component\Console\Style\SymfonyStyle; |
16 | 16 |
|
17 | | -#[AsCommand(name: 'mcp:test-prompt', description: 'Test an MCP prompt with simulated arguments')] |
| 17 | +#[AsCommand(name: 'mcp:test-prompt', description: 'Test an MCP prompt with simulated input')] |
18 | 18 | class TestMcpPromptCommand extends Command |
19 | 19 | { |
20 | 20 | private const NOT_SPECIFIED = 'Not specified'; |
@@ -99,9 +99,9 @@ protected function configure(): void |
99 | 99 | ->addArgument('prompt', InputArgument::OPTIONAL, 'The name of the prompt to test') |
100 | 100 | ->addOption('input', '-i', InputOption::VALUE_OPTIONAL, 'JSON input for the prompt') |
101 | 101 | ->addOption('list', '-l', InputOption::VALUE_NONE, 'List all available prompts') |
102 | | - ->setDescription('Test an MCP prompt with simulated inputs') |
| 102 | + ->setDescription('Test an MCP prompt with simulated input') |
103 | 103 | ->setHelp(<<<'EOT' |
104 | | -mcp:test-prompt {prompt? : The name of the prompt to test} {--inputs= : JSON input for the prompt} {--list : List all available prompts} |
| 104 | +mcp:test-prompt {prompt? : The name of the prompt to test} {--input= : JSON input for the prompt} {--list : List all available prompts} |
105 | 105 | EOT |
106 | 106 | ); |
107 | 107 | } |
@@ -131,12 +131,12 @@ private function testPrompt(): int |
131 | 131 | $arguments = $this->getArgumentsFromOption() |
132 | 132 | ?? $this->askForArguments($prompt->getArguments()); |
133 | 133 | if ($arguments === null) { |
134 | | - throw new TestMcpPromptCommandException('Invalid inputs.'); |
| 134 | + throw new TestMcpPromptCommandException('Invalid input.'); |
135 | 135 | } |
136 | 136 |
|
137 | 137 | // Execute the prompt |
138 | 138 | $this->io->text([ |
139 | | - 'Executing prompt with inputs:', |
| 139 | + 'Executing prompt with input:', |
140 | 140 | json_encode($arguments, JSON_PRETTY_PRINT), |
141 | 141 | ]); |
142 | 142 |
|
@@ -222,7 +222,7 @@ public function displaySchema(PromptInterface $prompt): void |
222 | 222 | public function getArgumentsFromOption(): ?array |
223 | 223 | { |
224 | 224 | // If arguments are provided as an option, use that |
225 | | - $argumentsOption = $this->input->getOption('inputs'); |
| 225 | + $argumentsOption = $this->input->getOption('input'); |
226 | 226 | if ($argumentsOption) { |
227 | 227 | try { |
228 | 228 | $decodedArguments = json_decode($argumentsOption, true); |
@@ -301,7 +301,7 @@ private function listAllPrompts(): int |
301 | 301 | $this->io->text([ |
302 | 302 | 'To test a specific prompt, run:', |
303 | 303 | ' php bin/console mcp:test-prompt [prompt_name]', |
304 | | - " php bin/console mcp:test-prompt [prompt_name] --inputs='{\"name\":\"value\"}'", |
| 304 | + " php bin/console mcp:test-prompt [prompt_name] --input='{\"name\":\"value\"}'", |
305 | 305 | ]); |
306 | 306 |
|
307 | 307 | return Command::SUCCESS; |
|
0 commit comments