Skip to main content
Glama
ketiil

ServiceNow CMDB MCP Server

by ketiil

count_cis

Read-onlyIdempotent

Count configuration items in ServiceNow CMDB based on a query, optionally grouping by a field for per-value counts.

Instructions

Count configuration items matching a query using the Aggregate API.

Uses the ServiceNow Stats API (/api/now/stats) for efficient counting without fetching actual records. Optionally group results by a field to get counts per value.

Examples: count_cis(table="cmdb_ci_server", group_by="operational_status") count_cis(table="cmdb_ci", group_by="sys_class_name") count_cis(table="cmdb_ci_linux_server", encoded_query="os=Linux Red Hat")

Args: table: CMDB table to count records in (e.g. cmdb_ci_server). Defaults to cmdb_ci. encoded_query: Optional encoded query to filter which CIs to count. Example: "operational_status=1" to count only operational CIs. group_by: Optional field name to group counts by (e.g. "sys_class_name" to get counts per CI type, or "operational_status" for counts per status).

Returns: JSON object with the aggregate count result. When group_by is used, returns counts broken down by each distinct value of that field.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableNocmdb_ci
encoded_queryNo
group_byNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already declare readOnlyHint, destructiveHint, idempotentHint. Description adds useful context: uses Stats API, supports grouping, returns JSON. No contradictions.

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?

Well-structured with examples and parameter list. Slightly lengthy but every sentence adds value. Could be slightly more concise.

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?

Completely covers the tool's purpose, parameters, return value, and usage. With output schema present, description explains aggregate result behavior adequately.

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 0% schema description coverage, description compensates by explaining each parameter with defaults and examples. Clear and helpful.

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?

Clearly states it counts configuration items using the Aggregate API, distinguishing from sibling tools like search_cis and query_cis_raw. Uses specific verb 'count' and resource 'configuration items'.

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?

Provides examples and implies use for efficient counting instead of fetching records. Lacks explicit when-not-to-use or alternative comparisons but is clear enough.

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/ketiil/mcp-cmdb'

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