Skip to main content
Glama
servicenow-mcp-ai

servicenow-mcp-ai

by IvanBBaev

Query ServiceNow table

servicenow_query_table
Read-onlyIdempotent

Read records from any ServiceNow table with encoded queries, selected fields, paging, and optional fetch-all support. Use it to retrieve, filter, and export table data through the Table API.

Instructions

Read records from any table (Table API): encoded query, fields, paging, fetchAll. '^' cannot be escaped inside a value; very long queries can hit HTTP 414 — split them. See the servicenow://reference/encoded-query resource.

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": "servicenow_query_table"
  }
}

Input Schema

NameRequiredDescriptionDefault
viewNoUI view's fields (sysparm_view); 'fields' wins.
limitNoMax records (default 10).
queryNoEncoded query (sysparm_query), e.g. 'active=true^ORDERBYDESCsys_created_on'.
tableYesTable, e.g. 'incident'.
domainNoOnly this domain's rows (sys_id).
fieldsNoColumns (default all); 'summary': the list view's.
formatNo'json' (default), 'csv', 'table' (columns + rows) or 'file': the full (redacted) result to <profile>/exports/.
offsetNoRecords to skip (paging).
explainNoRead no records: which conditions can use an index, with cost notes (advice).
noCountNoSkip the row count (sysparm_no_count): faster on huge tables; 'total' unknown.
fetchAllNoAll matches (≤ SN_MAX_RECORDS): sys_id cursor without an ORDERBY (stable), else offset.
instanceNoProfile (default active)
omitEmptyNoDrop empty cells; columns are listed.
fileFormatNoWith format 'file': 'csv' (default; columns from 'fields' or page 1) or 'jsonl' (all keys).
displayValueNo'true' display, 'false' raw (default), 'all' both, 'display' compact ([sys_id, name] refs).
queryCategoryNosysparm_query_category, e.g. a read replica.
queryNoDomainNoQuery all accessible domains (sysparm_query_no_domain).
suppressPaginationHeaderNosysparm_suppress_pagination_header.

Output Schema

NameRequiredDescriptionDefault
noteNo
rowsNo
countNo
totalNo
formatNo
explainNo
recordsNo
truncatedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed28 schema fields changedv3.0.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • changedInput schema / properties / displayValue / description
      Previous value: -"Return display values ('true'), raw values ('false', default) or both ('all')."New value: +"'true' display, 'false' raw (default), 'all' both, 'display' compact ([sys_id, name] refs)."
    • changedInput schema / properties / displayValue / enum
      Previous value: -[
      -  "true",
      -  "false",
      -  "all"
      -]New value: +[
      +  "true",
      +  "false",
      +  "all",
      +  "display"
      +]
    • addedInput schema / properties / domain
      Added value: +{
      +  "description": "Only this domain's rows (sys_id).",
      +  "pattern": "^[A-Za-z0-9_-]{1,32}$",
      +  "type": "string"
      +}
    • addedInput schema / properties / explain
      Added value: +{
      +  "description": "Read no records: which conditions can use an index, with cost notes (advice).",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / fetchAll / description
      Previous value: -"When true, page through all matching records (up to the server's SN_MAX_RECORDS cap) instead of a single page."New value: +"All matches (≤ SN_MAX_RECORDS): sys_id cursor without an ORDERBY (stable), else offset."
    • addedInput schema / properties / fields / anyOf
      Added value: +[
      +  {
      +    "items": {
      +      "maxLength": 255,
      +      "pattern": "^[A-Za-z0-9_.]+(?:\\s*,\\s*[A-Za-z0-9_.]+)*$",
      +      "type": "string"
      +    },
      +    "maxItems": 200,
      +    "type": "array"
      +  },
      +  {
      +    "const": "summary",
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / fields / description
      Previous value: -"Columns to return. Omit to return all columns."New value: +"Columns (default all); 'summary': the list view's."
    • removedInput schema / properties / fields / items
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / fields / type
      Removed value: -"array"
    • addedInput schema / properties / fileFormat
      Added value: +{
      +  "description": "With format 'file': 'csv' (default; columns from 'fields' or page 1) or 'jsonl' (all keys).",
      +  "enum": [
      +    "csv",
      +    "jsonl"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / format / description
      Previous value: -"Output format: 'json' (default), or 'csv' for a spreadsheet-friendly export."New value: +"'json' (default), 'csv', 'table' (columns + rows) or 'file': the full (redacted) result to <profile>/exports/."
    • changedInput schema / properties / format / enum
      Previous value: -[
      -  "json",
      -  "csv"
      -]New value: +[
      +  "json",
      +  "csv",
      +  "table",
      +  "file"
      +]
    • changedInput schema / properties / instance / description
      Previous value: -"Connection profile to use for this call (default: the active profile). See servicenow_list_instances."New value: +"Profile (default active)"
    • addedInput schema / properties / instance / maxLength
      Added value: +128
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of records to return (default 10)."New value: +"Max records (default 10)."
    • addedInput schema / properties / noCount
      Added value: +{
      +  "description": "Skip the row count (sysparm_no_count): faster on huge tables; 'total' unknown.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / offset / description
      Previous value: -"Number of records to skip, for pagination."New value: +"Records to skip (paging)."
    • addedInput schema / properties / omitEmpty
      Added value: +{
      +  "description": "Drop empty cells; columns are listed.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / query / description
      Previous value: -"Encoded query (sysparm_query), e.g. 'active=true^priority=1^ORDERBYDESCsys_created_on'."New value: +"Encoded query (sysparm_query), e.g. 'active=true^ORDERBYDESCsys_created_on'."
    • addedInput schema / properties / query / maxLength
      Added value: +8000
    • addedInput schema / properties / queryCategory
      Added value: +{
      +  "description": "sysparm_query_category, e.g. a read replica.",
      +  "maxLength": 255,
      +  "type": "string"
      +}
    • addedInput schema / properties / queryNoDomain
      Added value: +{
      +  "description": "Query all accessible domains (sysparm_query_no_domain).",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / suppressPaginationHeader
      Added value: +{
      +  "description": "sysparm_suppress_pagination_header.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / table / description
      Previous value: -"Table name, e.g. 'incident', 'sys_user', 'change_request'."New value: +"Table, e.g. 'incident'."
    • addedInput schema / properties / table / pattern
      Added value: +"^[A-Za-z0-9_]{1,80}$"
    • addedInput schema / properties / view
      Added value: +{
      +  "description": "UI view's fields (sysparm_view); 'fields' wins.",
      +  "maxLength": 255,
      +  "type": "string"
      +}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": {},
      +  "properties": {
      +    "count": {
      +      "type": "number"
      +    },
      +    "explain": {},
      +    "format": {
      +      "type": "string"
      +    },
      +    "note": {
      +      "type": "string"
      +    },
      +    "records": {
      +      "type": "array"
      +    },
      +    "rows": {
      +      "type": [
      +        "number",
      +        "array"
      +      ]
      +    },
      +    "total": {
      +      "type": "number"
      +    },
      +    "truncated": {
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observedv2.0.1

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint/idempotentHint, so the safety profile is covered. The description adds genuinely non-obvious operational context: '^' cannot be escaped inside a value, and very long queries can trigger HTTP 414 and must be split. It does not discuss result-set size caps or redaction behavior of the 'file' format, leaving some operational gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences, each earning its place: purpose first, then two concrete operational caveats, then a pointer to deeper docs. No filler or restatement of the title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present and all parameters documented, the description only needs to supply the quirks an agent can't infer. It covers the encoded-query escaping/414 risk and defers to a reference resource, which is largely sufficient for an 18-parameter tool, though fetchAll vs limit interaction could be spelled out a bit more.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all 18 parameters are already documented in the schema; baseline is 3. The description restates the main knobs (encoded query, fields, paging, fetchAll) and adds the '^' escaping caveat, but adds little beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Read records from any table') and names the underlying API (Table API). An agent can distinguish this general query tool from servicenow_get_record and servicenow_aggregate without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the read/query framing and the pointer to the encoded-query reference resource, but the description never explicitly contrasts this with sibling tools such as get_record (single record) or aggregate. No when-not guidance is given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.