run_script
Executes ordered Electron debugging steps with variables, conditional branches, assertions, retries, and failure screenshots; optionally exports recorded workflows as Playwright tests.
Instructions
Advanced server-side step runner & workflow engine: executes an array of tool steps sequentially with templating ({{vars.x}}, {{steps[0].result.x}}, {{secret:KEY}}), conditional branching (if), assertions (expect), automatic retries, diagnostic failure screenshots, and optional export to Playwright test specs.
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": {
"script": "<script>"
},
"name": "run_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | Array of steps or path/JSON string to execute | |
| exportAs | No | Export the executed steps as executable Playwright test code or JSON recipe | |
| processId | No | Target process ID. If omitted, uses the single running app. | |
| variables | No | Initial variables map for {{vars.name}} interpolation | |
| exportPath | No | Optional file path on disk to save the exported test or JSON recipe | |
| stopOnFirstError | No | Whether to halt script execution upon first step failure (default: true) | |
| captureFailureArtifacts | No | Whether to automatically capture screenshot artifacts and diagnostic logs on step failure (default: true) |