purge_devices
Bulk-delete device inventory rows by applying a single filter (hostname, status, last seen age, or IP range). Preview deletions with dry run.
Instructions
Bulk-delete sitemap rows by filter. Single mutually-exclusive filter per call selected by filter_type. Supported filter_types: 'hostname' (exact-match string, no glob/LIKE), 'last_seen_older_than_days' (integer N — rows where last_seen < now - N days, exclusive boundary; N=0 matches all rows older than this instant), 'status' (exact match string like 'error' or 'success'), 'ip_range' (CIDR string like '192.168.1.0/24' or '2001:db8::/32' — rows whose connection_ip is not a valid IP are silently skipped). Composite/ANDed filters are NOT supported (use two calls). Pass dry_run=true to preview the candidate set without deleting. Zero-match returns success with purged_count=0, never an error. Note: filter_type='status', value='error' covers ONLY status='error' rows; use purge_failed_discoveries for the broader failed-discovery filter (includes zombie hostnames). Use remove_device for inventory-only deletion of one row; use purge_devices for bulk filter-based inventory deletion; use decommission_device when host-side cleanup (stop services, remove from clusters) is required before deletion.
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": {
"filter_type": "<filter_type>",
"value": "<value>"
},
"name": "purge_devices"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes | Filter value. Shape varies by filter_type: hostname/status -> string, last_seen_older_than_days -> integer, ip_range -> CIDR string. | |
| dry_run | No | If true, return candidates without deleting (default: false). | |
| filter_type | Yes | Filter to apply (exactly one per call). See tool description for per-filter value-shape examples. |