Skip to main content
Glama

fluent_query

Read-only

Build and run ServiceNow database queries with filters, field selection, sorting, limits, and aggregations. Retrieve records or compute COUNT, AVG, SUM, MIN, MAX results.

Instructions

GlideQuery-style fluent query builder. Supports select, where, aggregate (COUNT/AVG/SUM/MIN/MAX), orderBy, limit, and groupBy. Returns records or aggregate results. Example: { table: "incident", where: [["active","=",true],["priority","<",3]], select: ["number","short_description"], limit: 10 }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax records to return (default: 20, max: 200)
tableYesTable name (e.g., "incident")
whereNoArray of conditions: [field, operator, value]. Operators: =, !=, >, >=, <, <=, LIKE, STARTSWITH, CONTAINS, IN, NOT IN, ISEMPTY, ISNOTEMPTY
selectNoFields to return. Supports dot-walking (e.g., "caller_id.email"). If omitted, returns all fields.
groupByNoField to group results by (for aggregate queries)
orWhereNoArray of OR conditions (same format as where)
orderByNoField to sort by. Prefix with "-" for descending.
aggregateNoAggregate operation: COUNT, AVG, SUM, MIN, MAX
displayValueNoReturn display values instead of internal values (default: false)
aggregateFieldNoField to aggregate on (required for AVG, SUM, MIN, MAX)
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true. The description adds return behavior ('Returns records or aggregate results') and a concrete example, providing value beyond annotations. It does not contradict annotations, though it does not detail pagination or response format.

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?

The description is very concise: two sentences and a compact example. It front-loads the purpose, lists supported features, states the return type, and gives an illustrative usage. No waste or redundancy.

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?

This is a complex tool with 10 parameters and no output schema. The description covers core query operations and includes an example, but it does not explain aggregate query construction in depth or provide guidance on selecting this tool over sibling query tools. Given the rich input schema, it is reasonably complete, though not exhaustive.

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?

With 100% schema description coverage, the schema provides full parameter documentation. The description adds a working example demonstrating parameter combinations (where, select, limit), which enhances understanding beyond the schema alone. Some parameters like orWhere and displayValue are not mentioned in the description, but the schema already covers them.

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?

Description clearly identifies the tool as a 'GlideQuery-style fluent query builder' and lists supported operations (select, where, aggregate, orderBy, limit, groupBy) and return types. However, it does not explicitly differentiate from sibling query tools like query_records or run_aggregate_query, so it falls short of full distinction.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives such as query_records, run_aggregate_query, or nlq_query. There are no exclusions, prerequisites, or contextual hints to help an agent choose between similar query capabilities.

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/aartiq/servicenow-mcp'

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