Run script
run_scriptExecute a saved Python script with the axross API imported when file tools lack needed logic; pass arguments, set a timeout, and capture stdout, stderr, exit status, and globals.
Instructions
Run a saved Python script in a child process with the axross API imported. Use when: a job needs logic the file tools lack; write it with write_script after get_script_api. Instead: run_backend_command on a remote host. Requires: --mcp-allow-scripts (stdio only); not in paranoid mode. Behavior: destructive - runs with the server user's full rights, outside the MCP root. stdin is empty: API prompts raise NonInteractiveError unless passed assume_yes=True. Over 1 MiB of output fails the call (its effects stay). Time limit: timeout, then the run is killed and returns timed_out true with the output so far. Returns: {name, exit (negative: killed by that signal), timed_out, duration_ms, stdout, stderr, namespace_keys (globals left)}, plus {error_type, error, traceback} after an exception.
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>"
},
"name": "run_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Command-line arguments, the script's sys.argv[1:], e.g. ['--dry-run', 'docs']; no NUL characters. | |
| name | Yes | The script's name, from list_scripts: letters, digits, '_' and '-', at most 80 characters, without '.py', e.g. 'disk_report'. | |
| timeout | No | Wall-clock limit for the run in seconds. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| exit | Yes | ||
| name | Yes | ||
| error | No | ||
| stderr | Yes | ||
| stdout | Yes | ||
| timed_out | Yes | ||
| traceback | No | ||
| error_type | No | ||
| duration_ms | Yes | ||
| namespace_keys | Yes |