Skip to main content
Glama

dijkstra_path

Finds the shortest path between two nodes in a weighted graph using Dijkstra's algorithm, with optional directed-graph support.

Instructions

Find the shortest path between two nodes in a weighted graph (Dijkstra's algorithm).

Input Schema

NameRequiredDescriptionDefault
edgesYesArray of [from, to, weight] triples.
sourceYesSource node name.
targetYesTarget node name.
directedNoTreat graph as directed (default false).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.11

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden and does not meet it. It omits critical traits: that Dijkstra does not support negative edge weights, the default directedness, whether a path is always returned when one exists, and what the response contains (path vs. cost).

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?

A single tight sentence with the purpose front-loaded and no filler. It is efficient, though the brevity comes at the cost of the usage and behavior detail noted elsewhere.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no annotations and no output schema, the description should explain what the tool returns (path sequence, total weight, unreachable-node behavior) and the negative-weight limitation. For a 4-parameter algorithmic tool, one sentence is insufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents source, target, edges, and directed. The description adds only the notion of a weighted graph, which the schema's [from, to, weight] triple description also implies, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (Find), resource (shortest path between two nodes), and the algorithm used, so the agent knows exactly what computation occurs. However, it offers no differentiation from close siblings like astar_path, bellman_ford, or bfs_search, which an agent must choose between in a large graph-algorithm family.

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

Usage Guidelines2/5

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

There is no guidance on when to prefer Dijkstra over astar_path (heuristic-guided), bellman_ford (negative weights), or floyd_warshall (all-pairs). No prerequisites or exclusions are stated, leaving selection entirely to inference.

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

Deploy Server

Other Tools