Skip to main content
Glama
ketiil

ServiceNow CMDB MCP Server

by ketiil

query_cis_raw

Read-onlyIdempotent

Execute raw ServiceNow encoded queries on CMDB tables to retrieve configuration items with pagination and field selection.

Instructions

Execute a raw encoded query against any CMDB table.

For advanced users who know ServiceNow encoded query syntax. The query is passed directly to the Table API's sysparm_query parameter without modification.

Note: Server-side script expressions (javascript:, gs.*, eval) are blocked for security. Use field-based operators only.

Examples of encoded queries: "nameSTARTSWITHweb^operational_status=1" — operational CIs starting with "web" "sys_class_name=cmdb_ci_linux_server^ip_addressISNOTEMPTY" — Linux servers with IPs "sys_updated_onRELATIVEGT@dayofweek@ago@90" — CIs updated in the last 90 days "assigned_to.nameLIKESmith^ORmanaged_by.nameLIKESmith" — CIs assigned to or managed by someone named Smith "install_status=1^operational_status=1^sys_class_nameINcmdb_ci_linux_server,cmdb_ci_win_server" — installed and operational servers "sys_updated_on<2025-01-01" — CIs not updated since a specific date

Args: table: ServiceNow table name (e.g. cmdb_ci, cmdb_ci_server, cmdb_ci_win_server). encoded_query: Raw ServiceNow encoded query string. fields: Specific fields to return. Defaults to sys_id, name, sys_class_name, operational_status, ip_address, location, sys_updated_on. limit: Maximum number of results to return (1-1000, default 25). offset: Pagination offset for retrieving subsequent pages. display_value: Controls how reference fields (location, company, assigned_to, etc.) are returned. "" (default) returns raw sys_id values. "true" returns human-readable display values (e.g. "New York" instead of a sys_id). "all" returns both as {"value": sys_id, "display_value": "New York"}. Use "true" when presenting data to users; use "all" when you need both the sys_id (for API calls) and the display name.

Returns: JSON object with "count" (results on this page), "records" (list of CI dicts), "total_count", "has_more", "next_offset", and "suggested_next". When display_value="all", each reference field in a record is returned as {"value": sys_id, "display_value": label} instead of a plain sys_id string.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYes
encoded_queryYes
fieldsNo
limitNo
offsetNo
display_valueNo

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=true, destructiveHint=false, and idempotentHint=true. The description adds context about security blocking of server-side scripts and the behavior of the display_value parameter, which enriches the agent's understanding without contradiction.

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 well-organized into sections: purpose, security note, examples, and parameter details. Every sentence adds value. It is front-loaded with the core purpose, and examples are clearly formatted. No redundancy.

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?

Given the tool's complexity (6 parameters, raw query, security nuance), the description is complete. It explains all parameters, the return structure (even though an output schema exists), and security constraints. No gaps remain.

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 description coverage is 0%, meaning the description must compensate. It does so thoroughly: explains each parameter's purpose, provides examples for encoded_query, lists default fields, defines range for limit and offset, and details display_value modes with usage advice.

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 states 'Execute a raw encoded query against any CMDB table.' This provides a specific verb and resource, clearly distinguishing from sibling tools like 'search_cis' or 'count_cis' by emphasizing the raw, direct query approach.

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 notes that this is for advanced users who know ServiceNow encoded query syntax, and warns that server-side scripts are blocked. However, it does not directly compare with alternatives like 'search_cis' to indicate when to use one versus the other.

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