Skip to main content
Glama
ausper-tech

servicenow-mcp

by ausper-tech

Count matching records

servicenow_count_records
Read-onlyIdempotent

Count records in a ServiceNow table matching a query, returning only the count without transferring data. Efficiently answers 'how many' questions with minimal overhead.

Instructions

Count records matching a query without transferring any of them. One request, a few bytes, and no context cost regardless of the number. Prefer this over querying with a large limit whenever the question is 'how many'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoA ServiceNow encoded query. This is NOT SQL: conditions are joined by '^' for AND and '^OR' for OR, with no spaces around operators, and there is no WHERE or SELECT. Example: 'active=true^priority=1^ORDERBYDESCsys_created_on'. Call servicenow_query_syntax for the full operator list. Omit to match every record. A query that names a field which does not exist returns zero records rather than an error, so verify field names with servicenow_describe_table when a result is unexpectedly empty.
tableYesSystem name of the table, not its UI label: 'sys_user' rather than 'User', 'incident' rather than 'Incidents'. Use servicenow_list_tables to find it.
Behavior5/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and destructiveHint. The description adds valuable behavioral details: low cost ('One request, a few bytes'), and the query behavior for non-existent fields ('returns zero records rather than an error'). No contradiction with annotations.

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 front-loaded with the core purpose, uses short sentences, and includes only pertinent details. Every sentence earns its place, no 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?

With no output schema, the description could mention the return format (e.g., an integer count). However, for a simple count tool, the behavior is sufficiently clear given the name and context. The description covers query behavior, schema usage, and performance benefits, making it almost complete.

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?

Schema coverage is 100%, but the description adds substantial meaning: for 'query' it explains the encoded query format, gives an example, and clarifies error behavior; for 'table' it distinguishes system name from UI label and directs to servicenow_list_tables. This goes well beyond the schema descriptions.

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 the tool counts records without transferring them, and explicitly contrasts with querying with a large limit. The verb 'count' and resource 'records' are specific, and the sibling differentiation is explicit ('Prefer this over querying with a large limit whenever the question is how many').

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 advises preferring this tool when the question is 'how many', and notes its efficiency. It does not explicitly list when not to use it, but the context implies it should not be used when actual records are needed (that would be servicenow_query_table). Could be more explicit about exclusions.

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

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