Skip to main content
Glama

bfs_search

Read-onlyIdempotent

Finds shortest unweighted paths and reachable node counts in a graph via breadth-first search. Returns visit order and optional target path.

Instructions

Breadth-first search on a graph. Finds shortest unweighted path, visit order, and reachable node count.

Input Schema

NameRequiredDescriptionDefault
edgesYesArray of edges
startYesStart node
targetNoOptional target node to find path to
directedNoWhether the graph is directed (default true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.11

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds real value by naming the three computed results (useful since there is no output schema), but stays silent on behavioral edge cases — e.g. cycle handling, unreachable target, or directed vs undirected effect on results.

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?

Two tight sentences, zero filler, with the algorithm front-loaded and the outputs immediately after. Nothing restates the tool name redundantly.

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

Completeness4/5

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

For a 4-parameter pure-computation tool with full schema coverage and no output schema, the description gives enough — it says what is computed and what comes back. Missing only a note on how `target` changes output shape (path vs. reachability) and error behavior on invalid start nodes.

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`, `target`, and `directed`. The description's only semantic contribution is the word 'unweighted', which constrains what kind of graph input is valid; otherwise the 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/resource ('breadth-first search on a graph') and enumerates the three outputs (shortest unweighted path, visit order, reachable node count). It does not distinguish itself from algorithmic siblings like dfs_search or dijkstra_path, so an agent must infer which graph traversal to pick.

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?

'Shortest unweighted path' implicitly signals this is for unweighted graphs as opposed to dijkstra_path/astar_path, which is a useful selection cue. But there is no explicit when-to-use statement, no mention of when to prefer dfs_search, and no guidance on what happens when `target` is omitted.

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