Skip to main content
Glama

bellman_ford

Computes shortest paths from a source node in weighted directed graphs, including negative edge weights, and optionally reconstructs the path to a target node.

Instructions

Find shortest paths from a source node using Bellman-Ford (handles negative edge weights).

Input Schema

NameRequiredDescriptionDefault
edgesYesArray of weighted directed edges
startYesStart node
targetNoOptional target node for path reconstruction

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.11

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description must carry the full behavioral burden. It discloses the important trait that negative edge weights are handled, but omits other critical behaviors such as negative-cycle detection, error handling, and whether it returns distances or paths.

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?

A single, front-loaded sentence with zero waste. The purpose and key advantage are stated immediately without unnecessary elaboration.

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?

Given a graph algorithm with no annotations and no output schema, the description is too sparse. It does not explain the return format (e.g., distances or reconstructed paths), how 'target' affects output, or negative-cycle handling, leaving an agent with insufficient context to interpret results.

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 'edges', 'start', and 'target'. The description adds no parameter-specific meaning beyond what the schema provides, making the baseline 3 appropriate.

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 shortest paths'), resource ('from a source node'), and algorithm ('Bellman-Ford'), with a key differentiator ('handles negative edge weights'). It clearly distinguishes itself from sibling graph tools like dijkstra_path, though it does not explicitly name them.

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

Usage Guidelines3/5

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

The parenthetical '(handles negative edge weights)' implies when this tool is preferable to Dijkstra-like alternatives, but there is no explicit guidance on when to use it versus other shortest-path tools. Usage is only implied.

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