Skip to main content
Glama

count_table

Count records in a ServiceNow table matching a query filter, returning only an integer. Use it for 'how many' questions without retrieving record data.

Instructions

Count records in a ServiceNow table matching a sysparm_query filter. Returns ONLY an integer count — no record data. Use this for 'how many' questions: 'how many P1 incidents this week?', 'what % of assets are Dell?'. Subject to the same table + query filter allowlist as query_table.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNosysparm_query filter string. Example: 'active=true^priority=1'. Some identity-revealing filters (like caller_id) are denied. Max 500 chars.
tableYesServiceNow table name. Must be in the allowlist (same as query_table).
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It clearly discloses the return type ('ONLY an integer count'), the absence of record data, and the allowlist restriction. This is good, but it omits details like error behavior, performance implications, or authentication requirements, which would have made it more complete.

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 three sentences, front-loaded with the core purpose in the first sentence, followed by usage examples and a constraint. Every sentence adds value and there is no redundant or filler content.

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?

Given the tool's low complexity (two parameters, simple integer output), the description adequately covers the purpose, usage context, and output type. It also mentions the allowlist constraint, which is important for proper invocation. The lack of an output schema is mitigated by the explicit statement about the return value.

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 input schema provides 100% coverage with clear descriptions for both parameters (`table` and `query`), including examples and max lengths. The tool description only paraphrases 'sysparm_query filter' and 'table', adding no new semantic meaning beyond the schema. Thus, the baseline score of 3 is appropriate.

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 uses a specific verb ('Count records') plus the resource ('ServiceNow table') and the filtering mechanism ('matching a sysparm_query filter'). It clearly distinguishes the tool from siblings like query_table by stating it 'Returns ONLY an integer count — no record data', which unambiguously defines its scope.

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 when to use the tool: 'Use this for 'how many' questions' with concrete examples. It also notes that it is 'Subject to the same table + query filter allowlist as query_table', giving a constraint. However, it does not explicitly name alternative tools or state when NOT to use it (e.g., 'use query_table if you need record data'), so it falls just short of a 5.

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/dadshorts/sn-mcp'

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