sn_query
Query ServiceNow tables using encoded queries, select specific fields, and control results with limits, offsets, and ordering to retrieve the records you need.
Instructions
Query any table by encoded query. Pass fields. Use sn_aggregate to count, and domain tools for code search when enabled.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "sn_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| query | No | Encoded query, not SQL: active=true^priority=1^ORpriority=2. Names: ref.name=X. | |
| table | No | Target table (REQUIRED), e.g. incident or alm_asset. | |
| fields | No | Comma-separated columns, dot-walk allowed: number,company.name. Avoid 'script'. | |
| offset | No | ||
| orderby | No | Order by field, supports -field for desc | |
| display_value | No | Resolve reference fields to display labels. Slower; opt-in only. | |
| include_count | No |