-
-
Notifications
You must be signed in to change notification settings - Fork 160
[Mate] Add mcp:tools:call command for tool execution via JSON input #1412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[Mate] Add mcp:tools:call command for tool execution via JSON input #1412
Conversation
| "twig/twig": "^3.22" | ||
| }, | ||
| "require-dev": { | ||
| "mcp/sdk": "0.3.0 as 0.2.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is currently needed to run the newest versions of mate (requires 0.3)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is only for development, i would rather not add this
it get's split into https://github.com/symfony/ai-demo as well - which currently only runs on ^0.2 versions of mate - so that issue is not relevant there i guess
b408aa3 to
a803352
Compare
Execute MCP tools directly from command line with JSON parameters. Features: - Accept tool name and JSON input as required arguments - Parse and validate JSON input against tool schema - Resolve and invoke tool handlers from DI container - Support pretty (default) and JSON output formats - Validate-only mode for testing parameters - Comprehensive error handling for invalid tools, JSON, and schema validation
a803352 to
bf1b304
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated - please revert here
| if ($this->isAssociativeArray($result)) { | ||
| $io->definitionList(...array_map(fn ($key, $value) => [$key => $this->formatValue($value)], array_keys($result), $result)); | ||
| } else { | ||
| foreach ($result as $item) { | ||
| $io->text($this->formatValue($item)); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that custom isAssociativeArray is similar but inverted to array_is_list?
| if ($this->isAssociativeArray($result)) { | |
| $io->definitionList(...array_map(fn ($key, $value) => [$key => $this->formatValue($value)], array_keys($result), $result)); | |
| } else { | |
| foreach ($result as $item) { | |
| $io->text($this->formatValue($item)); | |
| } | |
| } | |
| if (array_is_list($result)) { | |
| foreach ($result as $item) { | |
| $io->text($this->formatValue($item)); | |
| } | |
| } else { | |
| $io->definitionList(...array_map(fn ($key, $value) => [$key => $this->formatValue($value)], array_keys($result), $result)); | |
| } |
|
Not sure about this - from a theory point of view. You're skipping almost the entire SDK infrastructure and features for tools - which raises a couple of issues for tools that:
I would recommend to go through the entire stack there. |
Summary
This PR adds a new
mcp:tools:callcommand that enables executing MCP tools directly from the command line with JSON input parameters. This complements the existingmcp:tools:listandmcp:tools:inspectcommands, providing a complete CLI workflow for tool discovery, inspection, and execution.Features
Usage Examples
Execute tool with parameters
Execute tool with empty parameters
Implementation Details