run_background_script
Execute a server-side script in ServiceNow by creating a Fix Script record. Use dry_run to preview before running.
Instructions
Execute a server-side script in ServiceNow using the Background Scripts table (sys_script_fix).
IMPORTANT: Creates a Fix Script record and marks it for execution. The script runs as admin. Only use for safe, tested scripts. Always dry_run first to preview the record that will be created.
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>",
"script": "<script>"
},
"name": "run_background_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Descriptive name for this script run | |
| script | Yes | The server-side script to execute | |
| dry_run | No | If true, just show what would be created without running |