Skip to main content
Glama
ketiil

ServiceNow CMDB MCP Server

by ketiil

find_ci_path

Read-onlyIdempotent

Find the shortest relationship path between two configuration items in ServiceNow CMDB using bidirectional BFS. Discover how CIs are connected without full tree traversal.

Instructions

Find the shortest relationship path between two CIs.

Performs a bidirectional BFS (both upstream and downstream at each hop) to find the shortest chain of relationships connecting two CIs. Useful when you know both endpoints and want to understand how they are related without traversing the full tree.

Prerequisites: Use search_cis to find both CI sys_ids first.

Performance: BFS explores breadth-first with a limit of 10 relationships per node per direction. A hard 60-second timeout applies.

Examples: find_ci_path(source_sys_id="abc123...", target_sys_id="def456...") find_ci_path(source_sys_id="abc123...", target_sys_id="def456...", max_depth=3) find_ci_path(source_sys_id="abc123...", target_sys_id="def456...", max_depth=8)

Args: source_sys_id: The sys_id of the starting CI. target_sys_id: The sys_id of the target CI to find a path to. max_depth: Maximum hops to search (1-10, default 5). Higher values find longer paths but issue more API calls.

Returns: JSON object with "found" (bool), "hops" (number of relationships in the path), "path" (ordered list of nodes from source to target, each with "ci" details and "relationship_type"), "nodes_visited" (BFS cost indicator), and "suggested_next". When not found, also includes "max_depth_searched". When the BFS deadline is hit, also includes "timed_out": true and a "message".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_sys_idYes
target_sys_idYes
max_depthNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Annotations already show readOnlyHint=true, destructiveHint=false, idempotentHint=true. Description adds rich behavioral context: bidirectional BFS, 10 relationships per node per direction limit, 60-second timeout, and detailed return fields. No 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?

Well-structured with clear sections (purpose, algorithm, prerequisites, performance, examples, args, returns). Front-loaded key information, every sentence adds value, no fluff.

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?

Complete coverage: algorithm, limits, prerequisites, return format, examples, and error conditions (timeout). Given tool complexity, description leaves no gaps.

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%, so description fully explains each parameter: source_sys_id and target_sys_id as CI identifiers, max_depth with default 5, range 1-10, and behavioral impact on API calls. Adds significant meaning beyond schema.

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 it finds the shortest relationship path between two CIs using bidirectional BFS. It distinguishes from sibling tools like find_related_cis and get_dependency_tree by focusing on pathfinding between two known endpoints.

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 clear when-to-use: 'useful when you know both endpoints and want to understand how they are related without traversing the full tree.' Also includes prerequisites (use search_cis first) and performance limits. Lacks explicit when-not-to-use but context is strong.

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