Skip to main content
Glama
mfa-servicenow-mcp

mfa-servicenow-mcp

by jshsakura

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

NameRequiredDescriptionDefault
limitNo
queryNoEncoded query, not SQL: active=true^priority=1^ORpriority=2. Names: ref.name=X.
tableNoTarget table (REQUIRED), e.g. incident or alm_asset.
fieldsNoComma-separated columns, dot-walk allowed: number,company.name. Avoid 'script'.
offsetNo
orderbyNoOrder by field, supports -field for desc
display_valueNoResolve reference fields to display labels. Slower; opt-in only.
include_countNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.25.8
    • addedInput schema / properties / fields / description
      Added value: +"Comma-separated columns, dot-walk allowed: number,company.name. Avoid 'script'."
    • addedInput schema / properties / query / description
      Added value: +"Encoded query, not SQL: active=true^priority=1^ORpriority=2. Names: ref.name=X."
    • addedInput schema / properties / table / description
      Added value: +"Target table (REQUIRED), e.g. incident or alm_asset."
  2. Addedv1.21.21
  3. Removedv1.21.20
  4. First observedv1.18.41

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden, and it discloses very little. It implies a read operation but never states that nothing is mutated, what ACL or permission requirements apply, what the result shape is, or how limit/offset pagination behaves. With no output schema and no annotation coverage, this is a significant gap.

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

Conciseness4/5

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

Three short sentences, front-loaded with the core verb and resource, with no padding. The fragment 'Pass fields.' is abrupt but does carry an actionable directive rather than filler.

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

Completeness2/5

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

An eight-parameter query tool with no annotations and no output schema needs the description to explain return shape, pagination, and any limits, and it does none of these. The only completion beyond routing is the trailing 'when enabled' hedge, which is itself ambiguous. It leaves the agent guessing about what a result row looks like and how to page.

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?

The schema already documents query syntax (including 'not SQL' with an example), table, fields with dot-walk, orderby, and the slow display_value opt-in, covering 63% of parameters. The description only echoes 'encoded query' and adds the terse 'Pass fields', which nudges field selection but gives no syntax or default meaning of its own. The undocumented parameters (limit, offset, include_count) are not filled in either.

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

Purpose4/5

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

States a specific verb and resource: 'Query any table by encoded query'. It also names the sibling that handles counting (sn_aggregate), so the agent can distinguish the two without opening schemas. It stops short of naming the platform or the read-only scope explicitly.

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

Usage Guidelines4/5

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

It gives two concrete routing rules: use sn_aggregate for counts and 'domain tools' for code search when enabled. What's missing is guidance on when this beats query_local_graph, get_metadata_source, or sn_schema, and the phrase 'when enabled' leaves a condition unresolved.

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