Skip to main content
Glama
hjlrosales

EPANET MCP Server

by hjlrosales

add_valve

Insert a pressure-reducing valve (PRV) into an existing pipe to cap downstream pressure at a set value, splitting the pipe and validating the edit against the EPANET engine.

Instructions

Insert a pressure-reducing valve (PRV) in series with an existing pipe: the pipe is split — a new junction is created at a fraction along it, the original pipe is shortened to that junction, and a new PRV link runs from the junction to the pipe's downstream node, capping pressure there at the requested setting (e.g. to protect low-lying tap stands from excess static head). The edit is validated against the EPANET engine before it is applied — unique ids, realistic bounds, the edited model must re-parse with the junction as a junction, the valve as a PRV with the requested setting, and the pipe shortened as requested, node/link counts must increase by exactly one each, and the edited model must still solve hydraulically if the base model did. Previous simulation results are invalidated; re-run run_simulation to see the effect.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
linkIdYesId of the pipe to split with the valve (use get_links to list pipe ids). The PRV is inserted in series: the pipe is shortened and a new junction is created at the split point, so the valve caps pressure at the pipe's downstream node (node2) at the setting.
settingYesPRV pressure setting in the model's pressure units (m for SI models, psi for US-unit models). Range: 0 to 10000.
valveIdYesNew unique valve id (1-31 characters, no spaces and none of: + - . ;).
diameterNoDiameter of the new valve (mm for SI models, inches for US-unit models); defaults to the split pipe's diameter.
minorLossNoMinor-loss coefficient of the new valve; defaults to 0.
networkIdYesThe network id returned by load_network.
splitPositionNoWhere along the pipe (fraction from node1 toward node2) the split junction sits; defaults to 0.9 (near the downstream end, so most of the pipe keeps its length).
splitJunctionIdNoNew unique junction id at the split point; defaults to '<valveId>J'.
Behavior5/5

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

With no annotations provided, the description carries the full burden, and it excels: it details the split behavior, validation against EPANET (unique ids, bounds, re-parse, counts increase by exactly one, hydraulic solvability), and side effects (invalidation of previous simulation results). This is thorough and honest about the tool's impact, exceeding typical descriptions.

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 dense but every sentence adds value: from the core action to validation details and re-run guidance. It is front-loaded with the primary purpose and then elaborates. Slightly long, but no filler; a 4 reflects appropriate structure without being overly terse.

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?

Despite having no output schema, the description covers essential operational context: validation criteria, side effects, and follow-up (re-run run_simulation). It does not explicitly state the return value, but given the tool's complexity and the absence of an output schema, a brief mention of what it returns would be helpful; otherwise, it is complete for invocation.

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 100%, so the baseline is 3. The description adds meaningful context by explaining how parameters interact (e.g., linkId splits the pipe, setting caps pressure at downstream node) and clarifies defaults (splitPosition defaults to 0.9, diameter defaults to pipe's). This goes slightly beyond the schema, justifying a 4.

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 a specific action ('Insert a pressure-reducing valve (PRV) in series with an existing pipe') and explains the mechanism (pipe split, junction creation, PRV link). It distinguishes itself from sibling tools like set_valve_setting by focusing on creating a new valve rather than modifying an existing one, and from add_tank by targeting pipes. The example use case (protect low-lying tap stands) further clarifies intent.

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 description implies when to use the tool via the example (protect against excess static head) and notes that previous simulation results are invalidated, prompting re-running run_simulation. However, it does not explicitly contrast with alternatives such as set_valve_setting or add_tank, nor does it state when NOT to use it. The guidance is present but not explicit in routing the agent among siblings.

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