get_shortest_path
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
| Name | Required | Description | Default |
|---|---|---|---|
| at | No | ||
| dst_node | Yes | ||
| src_node | Yes | ||
| with_lsps | No | ||
| graph_time | Yes | ||
| failed_edges | No | ||
| failed_nodes | No | ||
| changed_edge_costs | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||