Query a ServiceNow table
servicenow_query_tableQuery and read records from any ServiceNow table using encoded queries. Retrieve incidents, changes, users, or CMDB items with field selection and pagination.
Instructions
Read records from any ServiceNow table using an encoded query. This is the main tool for answering questions about incidents, changes, users, CIs or anything else stored on the instance. Read-only. Results are capped by the server's policy and every cap applied is reported in the result.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum records to return. Clamped to the server's configured ceiling, and the clamp is reported. | |
| query | No | A ServiceNow encoded query. This is NOT SQL: conditions are joined by '^' for AND and '^OR' for OR, with no spaces around operators, and there is no WHERE or SELECT. Example: 'active=true^priority=1^ORDERBYDESCsys_created_on'. Call servicenow_query_syntax for the full operator list. Omit to match every record. A query that names a field which does not exist returns zero records rather than an error, so verify field names with servicenow_describe_table when a result is unexpectedly empty. | |
| table | Yes | System name of the table, not its UI label: 'sys_user' rather than 'User', 'incident' rather than 'Incidents'. Use servicenow_list_tables to find it. | |
| fields | No | Columns to return. Naming the few you need is markedly cheaper than the default of every column, and keeps results readable. Omit for all columns. | |
| offset | No | Records to skip; use with 'limit' to page. | |
| display_value | No | 'true' (the default here) resolves references to human-readable names, so assigned_to reads 'Alice Smith'. 'false' returns raw sys_ids, which you want when feeding a value into another query. 'all' returns both. | |
| include_total | No | Also report how many records match in total, at the cost of one extra request. Worth it whenever you need to know if you are seeing everything. |