Netbox Run Script
netbox_run_scriptRun a NetBox custom script and return its log and output. By default, changes are rolled back; set commit to keep them after confirming.
Instructions
Run a NetBox custom script and return its log and output.
Runs with commit=false (changes rolled back) unless commit is set. The script runs as a background job; if it is still running after wait_seconds, poll it with netbox_get_object('core.job', job id). Confirm with the user before commit=true.
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": "netbox_run_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Values for the script's input variables, e.g. {'site': 3, 'dry_run_note': 'test'}. Object variables take IDs. | |
| commit | No | Keep the script's database changes. False (default) runs it and rolls its changes back - use that first. | |
| script | Yes | Script ID, or 'module.ClassName' (e.g. 'cleanup.StaleIPs'). List scripts with netbox_get_objects on 'extras.script'. | |
| wait_seconds | No | How long to wait for the result. 0 returns as soon as the job is queued. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||