Skip to main content
Glama
hjlrosales

EPANET MCP Server

by hjlrosales

optimize_network

Simulate candidate edits to pipes, demands, pumps, or tanks to find the combination that minimizes or maximizes a selected metric, using copies so the base model stays unchanged.

Instructions

Search for the best combination of edits by evaluating an explicit grid of candidate choices on COPIES of a loaded network. For each variable (pipe diameter, junction demand, pump speed, or add_tank placement) you list the choices to try — for add_tank, the nodes to attach a tank to (junctions or reservoirs; plus, by default, the baseline with no tank, so 'try a tank at J2 vs R1 vs none' is one variable); every combination is validated against the EPANET engine and simulated, and the combination that minimizes/maximizes the chosen metric is returned with its full aggregate results. The base model and its stored results are NEVER modified. The search space (product of all choice lists) must fit within maxEvaluations (default 20, up to 100).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qualityNoAlso run water-quality analysis. Requires the model to have quality configured ([OPTIONS] Quality).
networkIdYesThe network id returned by load_network.
objectiveYes
variablesYesThe assets and candidate values to search over. Every combination is evaluated on a copy of the model; the base model is never modified.
maxEvaluationsNoMaximum number of candidate combinations to evaluate (default 20). The full search space (product of all values lists) must fit within this limit.
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool evaluates on copies, never modifies the base model or stored results, validates each combination against the EPANET engine, and returns the best combination with full aggregate results. It also notes the search space limit. It does not mention potential failure modes or timeout behavior, but covers the most important behavioral traits for safe usage.

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?

The description is a single dense paragraph but well-structured: it leads with the core purpose, then explains the variable types, the add_tank nuance, the non-destructive nature, and the constraint. Every sentence adds useful information, and it is appropriately sized for a tool with this complexity.

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 tool with nested objects, five parameters including a complex variables array, and no output schema, the description covers the essential context: what it does, how the search space is constructed, the safety guarantee, and that it returns the best combination with full aggregate results. It does not detail the exact return structure, but the absence of an output schema makes that a minor gap given the description's clarity on the high-level outcome.

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

Parameters4/5

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

Schema description coverage is high (80%), so the schema already documents each parameter. The description adds semantic value by explaining the concept of variables as a grid, detailing the add_tank baseline behavior (includeNone default true, 'try a tank at J2 vs R1 vs none' as one variable), and clarifying that the base model is never modified—context that helps an agent correctly construct the variables array and interpret the networkId parameter's role.

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?

The description clearly states the tool searches for the best combination of edits by evaluating an explicit grid of candidate choices on copies of a loaded network. It lists the specific variable types (pipe diameter, junction demand, pump speed, add_tank placement) and explicitly notes the base model is never modified, distinguishing it from the many set_* siblings.

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

Usage Guidelines4/5

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

The description implies when to use this tool: when you need to explore combinations of edits without modifying the base model. It states the search space constraint (maxEvaluations) and the non-destructive nature, which are key usage guidelines. However, it does not explicitly contrast with alternatives like run_candidate or the individual set_* tools, though the 'search' and 'copies' language makes the distinction clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hjlrosales/EPAnet-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server