rolldev_php_script
Run PHP scripts inside the php-fpm container by specifying project directory, script path, and optional arguments for Magento 2 or RollDev environments.
Instructions
Run a PHP script inside the php-fpm container
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | Path to the project directory | |
| script_path | Yes | Path to the PHP script relative to project root | |
| args | No | Additional arguments to pass to the script |
Implementation Reference
- server.js:178-204 (registration)Tool registration definition for 'rolldev_php_script' including its name, description, and input schema (requires project_path and script_path, with optional args array).
{ name: "rolldev_php_script", description: "Run a PHP script inside the php-fpm container", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to the project directory", }, script_path: { type: "string", description: "Path to the PHP script relative to project root", }, args: { type: "array", description: "Additional arguments to pass to the script", items: { type: "string", }, default: [], }, }, required: ["project_path", "script_path"], }, }, - server.js:571-586 (handler)Handler function runPhpScript() that executes the tool logic: constructs a 'roll cli php <script_path> [args...]' command and delegates to executeRollCommand().
async runPhpScript(args) { const { project_path, script_path, args: scriptArgs = [] } = args; const rollCommand = [ "cli", "php", script_path, ...scriptArgs, ]; return await this.executeRollCommand( project_path, rollCommand, `Running PHP script: ${script_path}`, ); } - server.js:307-308 (helper)Registration in the CallToolRequestSchema switch-case that maps the tool name 'rolldev_php_script' to the handler method this.runPhpScript().
case "rolldev_php_script": return await this.runPhpScript(request.params.arguments);