Skip to main content
Glama

min_cost_max_flow

Compute minimum-cost maximum flow through a network using successive shortest paths with SPFA, so you can solve flow optimization problems from vertex, edge, source, and sink inputs.

Instructions

Compute minimum cost maximum flow using successive shortest paths (SPFA).

Input Schema

NameRequiredDescriptionDefault
sinkYesSink vertex
edgesYesEdges as [from, to, capacity, cost]
sourceYesSource vertex
vertex_countYesNumber of vertices

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?

Annotations are absent, so the description carries the full burden of behavioral disclosure. It names the algorithm but doesn't state what the function returns (is it just the cost? the flow amount? the flow assignment?), whether it mutates inputs, or what happens with infeasible flows. For a procedural tool with zero annotation coverage, this leaves significant gaps.

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 sentence that front-loads the core verb and resource ('Compute minimum cost maximum flow') and appends the algorithmic method as a parenthetical. No wasted words, no repetition of the tool name.

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?

For a complex graph algorithm with four required parameters, no annotations, and no output schema, the description is too sparse. An agent needs to know the return format, edge cases (negative cycles?), and when to prefer this over dinic_max_flow or hungarian_assign. It should do more to be complete.

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 all four parameters in detail (edges as [from, to, capacity, cost], source, sink, vertex_count). The description adds no parameter-level information beyond validating the overall computation concept. Baseline 3 is appropriate when the schema does the heavy lifting.

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?

The description states a specific algorithmic operation (minimum cost maximum flow) with a named implementation approach (successive shortest paths / SPFA). This distinguishes it from generic max-flow siblings like dinic_max_flow and edmonds_karp by implying cost-awareness, though it doesn't 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 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 use this tool versus the numerous other graph algorithm siblings (dijkstra_path, bellman_ford, dinic_max_flow, edmonds_karp, hungarian_assign, etc.). No prerequisites, no mention of when min-cost-max-flow is preferable to plain max flow or shortest path, and no exclusions.

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