Bulk Delete Records
servicenow_bulk_deleteDelete multiple records from a ServiceNow table based on a query. Preview changes with dry-run before committing permanent deletion.
Instructions
Delete multiple records matching a query. Dry-run by default — always preview before committing.
Args:
table (string): Target table
query (string): Encoded query to select records to delete
dry_run (boolean): Preview without deleting (default: true). Set false to commit.
limit (number): Safety cap — max records to delete (default 20, max 100)
response_format: Output format
⚠️ Deletion is permanent. Always run with dry_run=true first to confirm scope.
Examples:
Preview stale test incidents → table="incident", query="short_descriptionLIKEtest^state=7^sys_created_onRELATIVELT@year@ago@2", dry_run=true
Remove obsolete CI records → table="cmdb_ci", query="install_status=7^sys_updated_onRELATIVELT@year@ago@5", dry_run=true
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return (1–100, default 20) | |
| query | No | Encoded ServiceNow query string (e.g., 'state=1^priority=1^assigned_to=javascript:gs.getUserID()'). Leave empty to return all records. | |
| table | Yes | ServiceNow table name (e.g., incident, change_request, sys_user) | |
| dry_run | No | Preview without deleting — set false to commit (default: true) | |
| response_format | No | Output format: 'markdown' (default) for human-readable or 'json' for structured data | markdown |