feat: Add output schema support to MCP tools (#153)
This commit is contained in:
parent
4c3e5e61c7
commit
c0938a19bd
1 changed files with 605 additions and 55 deletions
|
|
@ -23,7 +23,31 @@ final class EnvToolHandler
|
|||
*
|
||||
* @return array<string, string|int> the result, varying by APP_MODE
|
||||
*/
|
||||
#[McpTool(name: 'process_data_by_mode')]
|
||||
#[McpTool(
|
||||
name: 'process_data_by_mode',
|
||||
outputSchema: [
|
||||
'type' => 'object',
|
||||
'properties' => [
|
||||
'mode' => [
|
||||
'type' => 'string',
|
||||
'description' => 'The processing mode used',
|
||||
],
|
||||
'processed_input' => [
|
||||
'type' => 'string',
|
||||
'description' => 'The processed input data',
|
||||
],
|
||||
'original_input' => [
|
||||
'type' => 'string',
|
||||
'description' => 'The original input data (only in default mode)',
|
||||
],
|
||||
'message' => [
|
||||
'type' => 'string',
|
||||
'description' => 'A descriptive message about the processing',
|
||||
],
|
||||
],
|
||||
'required' => ['mode', 'message'],
|
||||
]
|
||||
)]
|
||||
public function processData(string $input): array
|
||||
{
|
||||
$appMode = getenv('APP_MODE'); // Read from environment
|
||||
|
|
|
|||
Loading…
Reference in a new issue