Skip to main content
Glama

floyd_warshall

Computes all-pairs shortest paths in weighted graphs, supporting directed or undirected edges.

Instructions

Compute all-pairs shortest paths using Floyd-Warshall.

Input Schema

NameRequiredDescriptionDefault
edgesYesArray of weighted edges
directedNoTreat as directed graph (default true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.11

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations, the description carries the full disclosure burden but only names the algorithm. It says nothing about the return shape (distance matrix vs. path list), how unreachable pairs are represented, whether negative cycles raise an error, or the O(V^3) cost. Only the core operation is implied.

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?

One tight sentence with the algorithm and output scope front-loaded and no filler. It is arguably too terse for a graph algorithm, but that gap is accounted for in completeness rather than padding here.

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?

There is no output schema and no annotations, so the description is the only place an agent could learn what comes back, yet it omits the return format entirely. For a tool whose result (all-pairs distances) is non-obvious to new callers, this leaves a real gap.

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%, and both parameters (edges, directed) are documented in the schema, so the description correctly leaves them alone. It adds no extra semantics (e.g., duplicate edges, absent nodes, weight sign) beyond the schema, which is a baseline 3.

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 (Compute), a precise resource (all-pairs shortest paths), and the algorithm used (Floyd-Warshall). The phrase 'all-pairs' implicitly distinguishes it from the single-source siblings (dijkstra_path, bellman_ford, astar_path) that populate the same toolset.

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?

No guidance on when to prefer this over dijkstra_path, bellman_ford, or bfs_search, and no mention of negative-edge capability (the main reason to pick Floyd-Warshall) or negative-cycle limitations. The agent must infer the use case entirely.

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