Skip to main content
Glama
Xerrion

servicenow-platform-mcp

by Xerrion

build_query

Construct a ServiceNow encoded query string from a JSON array of conditions to filter records.

Instructions

Build a ServiceNow encoded query string from a JSON array of conditions.

Each condition is an object with:

  • operator: The query operator (see groups below).

  • field: The field name (not required for new_query).

  • value: The comparison value (type depends on operator).

Operator groups: Comparison: equals, not_equals, greater_than, greater_or_equal, less_than, less_or_equal String: contains, starts_with, like, ends_with, not_like, does_not_contain Null / special: is_empty, is_not_empty, anything, empty_string Time: hours_ago, minutes_ago, days_ago, older_than_days Date: on, not_on, relative_gt, relative_lt, more_than Date part: datepart (requires part, dp_operator, dp_value) Range: between (requires start, end) Field comparison: gt_field, lt_field, gt_or_equals_field, lt_or_equals_field, same_as, not_same_as (use other_field for the second field name) Reference: dynamic, in_hierarchy Change detection: val_changes, changes_from, changes_to Logical: new_query (no field needed - inserts ^NQ separator) Related list: rl_query (requires related_table, related_field, rl_operator, value) List: in_list, not_in_list (value is a list of strings) OR: or_equals, or_starts_with Ordering: order_by (optional descending: boolean)

Args: conditions: JSON array of condition objects.

Returns the encoded query string in data.query. Pass this string as the query parameter to the query tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conditionsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations provided, so the description carries full burden. It explains the input structure and output, but does not disclose error handling, validation, or performance characteristics. Still, it is thorough for a transformation tool.

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?

The description is well-structured with bullet points and sections, front-loading the purpose. It is detailed but could be slightly more concise without losing clarity. Every sentence adds value.

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

Completeness5/5

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

With only one parameter but complex structure, the description covers all necessary details: operator groups, required fields for each, and the return format. It is fully self-contained for an agent to use the tool correctly.

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

Parameters5/5

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

The input schema has 0% description coverage, but the tool description provides an extensive explanation of the 'conditions' parameter, including allowed operator groups, required fields, and examples. This fully compensates for the schema gap.

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?

The description clearly states it builds a ServiceNow encoded query string from a JSON array of conditions. It differentiates from the sibling 'query' tool by explicitly noting the output should be passed as the query parameter to that tool.

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?

The description explicitly states the output should be passed to the 'query' tool, providing clear context. However, it does not explicitly state when not to use this tool or list alternatives beyond the sibling list.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Xerrion/servicenow-platform-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server