Query a table
table_queryQuery ServiceNow tables using encoded filters, page records with limit/offset and nextOffset, and select fields to keep result sets small.
Instructions
Query any table with an encoded query (e.g. active=true^priority=1). Returns records, paged with limit/offset; nextOffset says where to continue. Pass fields to keep results small. Password fields are redacted. A misspelt field in the query may be ignored by ServiceNow, so check the results.
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": {
"table": "<table>"
},
"name": "table_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum records to return. Defaults to the configured default, capped at maxRecords. | |
| query | No | Encoded query, e.g. active=true^priority<=2. Omit for all records. | |
| table | Yes | Table name, e.g. incident or cmdb_ci_server. | |
| fields | No | Field names to return (dot-walking allowed, e.g. caller_id.name). Default: all. | |
| offset | No | Records to skip (paging). Use nextOffset from the previous result. | |
| orderBy | No | Sort order. | |
| instance | No | Instance alias from the config (see instance_list). Defaults to the default instance. | |
| displayValue | No | raw = stored values, display = labels, both (default) = value and label when they differ. | |
| includeTotal | No | Include the total number of matching records (total) in the result. |