Skip to main content
Glama

smart_query

Read-onlyIdempotent

Resolve a natural-language request into a ServiceNow table + encoded query and (optionally) run it. Maps keywords to common tables (incident, change_request, problem, sc_request, sn_vul_vulnerable_item, cmdb_ci, sys_user, …), then infers…

Instructions

Resolve a natural-language request into a ServiceNow table + encoded query and (optionally) run it. Maps keywords to common tables (incident, change_request, problem, sc_request, sn_vul_vulnerable_item, cmdb_ci, sys_user, …), then infers conditions for priority (P1/critical/high), open vs closed state, "assigned to me"/unassigned, and time windows (today, yesterday, this/last week, this/last month, last N days). Conditions whose field does not exist on the resolved table are dropped and reported in unmatched_intents. Returns the interpretation (table, encoded_query, conditions) plus matching records. Set execute=false to preview the query without running it, or pass table to override resolution.

Input Schema

NameRequiredDescriptionDefault
limitNoMax records to return when executed (default 10, max 1000)
tableNoOptional: force this table instead of auto-resolving from keywords
executeNoRun the resolved query (default true). false = preview only.
descriptionYesNatural-language request, e.g. "P1 incidents still open from last month" / "先月の未解決 P1 インシデント"

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.15.1

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint, so the safety profile is covered. The description adds genuinely non-obvious behavior: conditions whose field is absent from the resolved table are silently dropped and surfaced in unmatched_intents. It could go further on how ambiguous requests are resolved when multiple tables match.

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?

One dense paragraph, front-loaded with the core resolve-then-optionally-execute action, followed by the mapping rules and the escape hatches. The parenthetical table list is long but earns its place by telling the agent what auto-resolution covers.

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?

No output schema, yet the description sketches the return value (interpretation of table, encoded_query, conditions, plus matching records) and the unmatched_intents side channel. Missing only details such as default result volume beyond the schema's limit default, which the schema already covers.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description still adds value by explaining what the keyword-to-table mapping and condition inference actually do for the required 'description' parameter, and frames 'execute' and 'table' in terms of the resolution workflow rather than merely restating their types.

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: resolves a natural-language request into a ServiceNow table plus encoded query, and optionally runs it. This clearly distinguishes it from list/query siblings like query_records and trend_query, since the input is NL, not structured filters.

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?

Gives concrete usage modes: 'Set execute=false to preview the query without running it, or pass table to override resolution.' It does not, however, position itself against alternatives like nlq_query, ai_search, or natural_language_search, all of which could plausibly attract the same request.

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

Deploy Server

Other Tools