Skip to main content
Glama
hjlrosales

EPANET MCP Server

by hjlrosales

assign_demands

Convert population data into per-junction base demands for an EPANET network, applying per-capita usage and peaking factor with validation and automatic unit conversion.

Instructions

Convert a population table into per-node base demands for a loaded network: demand = people × litersPerCapitaPerDay × peakingFactor ÷ 86400, converted from liters/second into the model's flow units (so GPM/CFS/MGD models get the right numbers automatically). The computed demands replace each junction's base demand through the same guarded, engine-validated path as set_junction_demand: every junction must exist, junctions with demand categories in the [DEMANDS] section are rejected (they override the [JUNCTIONS] column), each computed demand must be within the model's demand bounds, and the edited model must re-parse with exactly the requested demands and unchanged node/link counts. Previous simulation results are invalidated — re-run run_simulation afterwards. This is the 'population in, demands out' step of the GIS workflow (mcp_gis_roadmap.md Phase 3).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkIdYesThe network id returned by load_network.
perCapitaYesPer-capita consumption rate. Required — demands are never guessed from a default rate.
populationYesPopulation table: one entry per junction. Each nodeId must be unique and must be an existing junction.
Behavior5/5

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

With no annotations provided, the description carries full burden and does so excellently. It discloses the entire validation procedure: junction existence checks, rejection of demand-category junctions that override the [JUNCTIONS] column, demand bound enforcement, and re-parse verification with unchanged node/link counts. It also explicitly states that previous simulation results are invalidated and instructs to re-run run_simulation. No annotation contradiction exists.

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?

The description is dense but every sentence earns its place: purpose, formula, validation, side effects, and workflow context. It is front-loaded with the primary action, then provides necessary constraints and caveats. No fluff or redundancy; the structure is logical and scannable.

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

Completeness5/5

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

Given the complexity of three parameters with nested objects and no output schema, the description covers all critical aspects: what the tool does, how it computes, validation rules, side effects, and usage context. An agent has everything needed to decide when to call it and what to expect. The lack of a return-value description is irrelevant given the tool's action-oriented nature and the absence of an output schema.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds significant meaning beyond the field-level descriptions. It explains the calculation formula (demand = people × litersPerCapitaPerDay × peakingFactor ÷ 86400), the automatic unit conversion to the model's flow units, and the purpose of each parameter in context (e.g., 'Zero sets the demand to 0'). This goes well beyond the schema's per-field descriptions.

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 opens with a precise verb+resource: 'Convert a population table into per-node base demands for a loaded network.' It includes the exact formula and explicitly distinguishes itself from single-junction demand setting by referencing the same validation path as set_junction_demand. The purpose is unambiguous and clearly differentiated from siblings.

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

Usage Guidelines5/5

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

The description states when to use it: 'This is the "population in, demands out" step of the GIS workflow (mcp_gis_roadmap.md Phase 3).' It also implicitly contrasts with set_junction_demand by mentioning 'the same guarded, engine-validated path,' and provides the critical prerequisite that all junctions must exist and certain demand categories are rejected. This gives clear context for selection without ambiguity.

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