e2e-add-script
Runs a local JavaScript or TypeScript file and records it as a script step in an active e2e test at the chosen recording point. Use it when a test needs to execute local script logic.
Instructions
Run a local JavaScript (.mjs, .js) or TypeScript (.mts, .ts) file and record it as a script: step in an active e2e test. Use when the user requests a local script in the e2e test, and only then. Call it at the point in the recording where the script must run. Returns status, reason and stepCount. A failed script is not recorded. Check reason and the affected state before you retry. Over a link (argent link or ARGENT_TOOLS_URL), the tool refuses the call: record such an e2e test with no link.
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": "e2e-add-script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | E2E test name passed to e2e-start-recording. | |
| path | Yes | Path to the script file (.mjs, .mts, .js or .ts), relative to the e2e test YAML. For example: "../../scripts/seed-order.mjs". | |
| timeout | No | Time limit in milliseconds. The default is 30000 and the minimum is 100. | |
| project_root | Yes | Absolute project root passed to e2e-start-recording. |