flow-add-script
Run a local .mjs file and record it as a script step in an active flow. Use when a local script is requested, passing the same flow name and project root.
Instructions
Run a local .mjs file and record it as a script: step in an active flow. Use this tool only when the user requests a local script in the flow. Pass the same name and project_root as flow-start-recording, and call it where the script must run. A failed script is not recorded. Check reason and the affected state before you retry.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"project_root": "<project_root>",
"path": "<path>"
},
"name": "flow-add-script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Flow name passed to flow-start-recording. | |
| path | Yes | Path to the .mjs file, relative to the flow YAML. For example: "../../scripts/seed-order.mjs". | |
| timeout | No | Optional time limit in milliseconds. The default is 30000 and the minimum is 100. | |
| project_root | Yes | Absolute project root passed to flow-start-recording. |