Skip to main content
Glama

Topolograph

get_shortest_path

Read-onlyIdempotent

Calculate the shortest path from one node to one or several destinations.

Description: Plain IGP shortest path by default. For "what if this link is down" backup-path analysis, use get_edge_failure_reaction instead -- that question now has its own endpoint (whole-network impact, not just a recomputed path). Several dst_node values run one SPF from src_node and return a cost/path per target plus the union of every target's edges (MST-style, for colouring several VTEPs' underlay at once); with_lsps takes one destination only.

Input fields: graph_time (str): The graph time src_node (str or list[str]): Source node Router ID (e.g., "10.10.10.1"); a list of sources answers the union of all source-target paths (underlay) dst_node (str or list[str]): One destination Router ID, or several (e.g., ["20.20.20.1", "30.30.30.1"]) with_lsps (bool, optional): If true, account for autoroute-enabled MPLS-TE tunnels as forwarding shortcuts -- the path traffic actually takes given the tunnels currently in the graph, not the plain IGP path. Off by default (a signaled LSP does not redirect traffic on its own without autoroute configured on the tunnel). Keep it off unless the question is about MPLS TE autoroute. One dst_node only; the API rejects it with several. Not with at. failed_edges (list[str], optional): edge_key values from get_edges; the path with these links down (both directions) failed_nodes (list[str], optional): the path with these routers removed changed_edge_costs (dict, optional): edge_key -> new cost of that direction; keyed by edge_key, unlike resolve_route (igraph id) at (str, optional): ISO 8601 moment; state with watcher events applied up to it. Not with a network Routing of the request: - src_node or dst_node containing "/" is an IP or network; a host is given as x.x.x.x/32, since a bare IP is read as an OSPF Router ID - failed_edges, failed_nodes or changed_edge_costs set: backup path, one src and one dst, not with with_lsps - src_node as a list: underlay; not with with_lsps or failures

Output fields: One dst_node: dict with spt_path_nodes_name_as_ll_in_ll (list of node-name paths), cost, unbackup_paths_nodes_name_as_ll_in_ll. Several dst_node: dict with targets (keyed by each destination: cost, spt_path_nodes_name_as_ll_in_ll, unbackup_paths_nodes_name_as_ll_in_ll, or error when unresolved), plus the edges every target's path crosses.

Equivalent to GET /graph/{graph_time}/path/{src_node}/{dst_node}, or with the rules above GET /graph/{graph_time}/path/network, POST /graph/{graph_time}/analyse/spt-edge-failure or POST /graph/{graph_time}/analyse/underlay.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "graph_time": "<graph_time>",
      "src_node": "<src_node>",
      "dst_node": "<dst_node>"
    },
    "name": "get_shortest_path"
  }
}

Input Schema

NameRequiredDescriptionDefault
atNo
dst_nodeYes
src_nodeYes
with_lspsNo
graph_timeYes
failed_edgesNo
failed_nodesNo
changed_edge_costsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, open-world, and non-destructive behavior, but the description adds substantial operational context. It explains default IGP behavior, how with_lsps changes routing to account for autoroute-enabled MPLS-TE tunnels, that failed_edges applies both directions, that changed_edge_costs is keyed by edge_key unlike resolve_route, that multi-destination calls return the union of every target's edges, and which parameter combinations the API rejects.

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?

The description is well structured with purpose, input fields, routing rules, output fields, and equivalent endpoints, and it front-loads the key alternative. However, it is quite long and repeats some constraints, such as with_lsps restrictions appearing in both the field description and routing bullets, so it is not maximally 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?

For an 8-parameter graph analysis tool, the description covers defaults, parameter interactions, output shape for single and multiple destinations, and equivalent API endpoints. Since an output schema exists, the description need not exhaustively restate return values, and it provides enough context for correct invocation.

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 the description must carry parameter meaning, and it does: it documents all 8 parameters with examples and constraints. It clarifies dst_node single vs list behavior, src_node list underlay semantics, with_lsps default and one-destination restriction, failed_edges sourcing from get_edges, changed_edge_costs keying, and at as an ISO 8601 moment.

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?

States a specific verb and resource: calculate the shortest path from one node to one or several destinations. It explicitly distinguishes this tool from get_edge_failure_reaction for what-if link-down analysis and identifies the default as plain IGP shortest path.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use guidance by naming get_edge_failure_reaction for backup-path analysis. It also provides multiple exclusion and combination rules: with_lsps is off by default and only for MPLS-TE autoroute questions, accepts one dst_node only, and cannot combine with at; failure parameters require one src and one dst and cannot combine with with_lsps; a src_node list implies underlay and cannot combine with with_lsps or failures.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.