find_orphan_cis
Detect configuration items with no upstream or downstream relationships in ServiceNow CMDB to identify incomplete discovery or orphaned records.
Instructions
Find CIs that have no relationships in cmdb_rel_ci.
Orphan CIs are configuration items with zero upstream or downstream relationships (also called unlinked, isolated, or disconnected CIs). These often indicate incomplete discovery, manual entries that were never linked, or leftover records from decommissioned infrastructure.
Scans a batch of CIs and checks each against cmdb_rel_ci using IN-batch queries. Results may be partial if the orphan ratio is low — use scan_offset to continue scanning from where the previous call left off.
Performance: This tool issues multiple API calls per batch (fetches CIs, then checks parent and child relationships for batches of up to 100 CIs). Use cmdb_health_summary for a quick count without record-level detail. Narrow scope with ci_class or operational_status to reduce scan cost.
Examples: find_orphan_cis(ci_class="cmdb_ci_server", operational_status="1") find_orphan_cis(ci_class="cmdb_ci_linux_server", limit=50) find_orphan_cis(ci_class="cmdb_ci", scan_offset=100) # continue scanning
Args: ci_class: CMDB table to search for orphans (e.g. cmdb_ci_server). Defaults to cmdb_ci (all types). operational_status: Optional filter by operational status (e.g. "1" for Operational). limit: Maximum orphan CIs to return (1-1000, default 25). scan_offset: Offset into the CI table to start scanning from. Use the "next_offset" value from a previous response to continue.
Returns: JSON object with "ci_class", "count", "orphan_cis" list, "total_scanned" (CIs checked), "has_more", and "next_offset" (for continuation).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ci_class | No | cmdb_ci | |
| operational_status | No | ||
| limit | No | ||
| scan_offset | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |