Skip to main content
Glama

Agentic SWMM Workflow

Pre-1.0 · stable v0.9.3 · pip install aiswmm==0.9.3 · CHANGELOG

TIP

Headaches from tedious model setup? Try our another project SWMMCanada, our automated model-building project: draw an area anywhere in Canada and get a ready-to-run SWMM model. Up and running now.

Highlights

  • Agentic SWMM for reproducible stormwater modeling: the aiswmm runtime + Skills + MCP + SWMM, verification-first, with a full audit trail.

  • Live demo, no install: try it in the browser at aiswmm.com.

  • One prompt to client deliverable: one English sentence fetched the real downtown Victoria storm network, ran SWMM, audited it, and exported a Word report: cases/downtown-victoria.

  • A model that said not to trust it: when the requested week turned out dry, the run named its own errors as disqualifying instead of handing over bad numbers: cases/downtown-victoria-on-arm.md.

  • Real networks upstream: SWMMCanada covers 35 Canadian cities, SWMManywhere synthesis covers the rest of the globe.

  • Bring the LLM you already pay for: ten provider routes behind one aiswmm setup wizard, with a local fallback chain.

  • Published research: published in AI for Engineering (MDPI, 2026): read the paper.

Related MCP server: SciAgentKit

Project Overview

Agentic SWMM is an open-source, verification-first framework for reproducible and extensible stormwater modelling, starting with EPA SWMM. It connects QGIS-based preprocessing, upstream model generation from SWMMCanada inside Canada (real storm networks for 35 cities, synthesis anywhere else in the country) and SWMManywhere-based synthesis outside Canada, deterministic SWMM execution, QA checks, provenance tracking, calibration and climate-scenario support, documentation, and modelling memory, while keeping human modellers in control.

The goal is not to replace SWMM or the modeller, but to build an agentic modelling layer that makes stormwater-modelling workflows easier to reproduce, audit, extend, remember, and trust. Agentic SWMM comes with aiswmm as its built-in runtime. Users can describe a modelling goal in natural language, while model execution remains deterministic, inspectable, and artifact-based. The repository's MCP servers and Skills can also be used with other agent runtimes, including Codex, Claude, OpenClaw, and Hermes.

This is not a simple chat-to-SWMM wrapper. The aiswmm runtime can help coordinate the workflow, but model files, SWMM runs, QA checks, plots, provenance records, audit notes, and modelling memory remain visible as reusable artifacts. Modelling memory can summarize repeated problems and propose Skill refinements, but accepted changes still require human review and benchmark verification.

Authors: Zhonghao Zhang & Caterina Valeo
License: MIT

Why this project exists

Stormwater modelling is rarely one command. A typical SWMM project can involve GIS preprocessing, rainfall formatting, parameter assignment, network assembly, INP construction, model execution, QA checks, plots, calibration, uncertainty analysis, and reporting.

Agentic SWMM provides a middle path: natural-language orchestration with deterministic SWMM execution, explicit provenance, project memory, and verification-first modelling.

What makes it different

  • Quick onboarding: start from one-line macOS/Linux or Windows installers, with Docker and Python package paths documented separately.

  • Agent-guided, SWMM-grounded: agents can coordinate tasks, while model execution stays deterministic, inspectable, and CLI-runnable.

  • Modular skill layer: GIS, climate, building, running, plotting, calibration, uncertainty, audit, and orchestration are separated into reusable modules with MCP interfaces where available.

  • Verification-first provenance: build, run, audit, and comparison stages emit traceable artifacts before outputs are treated as evidence.

  • Supervised skill evolution: audited runs can surface recurring workflow patterns and propose updates to existing skills or new skills, while staying coupled to the current skill-driven framework.

Meet your agent in about five minutes

macOS and Linux:

curl -fsSL https://aiswmm.com/install.sh | bash

Windows PowerShell:

irm https://aiswmm.com/install.ps1 | iex

Reproducible run (pinned Docker image, v0.9.3), no local install:

docker run --rm -v "$PWD/runs:/app/runs" ghcr.io/zhonghao1995/agentic-swmm-workflow:v0.9.3 acceptance

After installation, launch the runtime with aiswmm.

One-line installers run a remote script; review it first if you want to see what executes. When it finishes it hands over to aiswmm setup, which lists every route and detects what is already running; three of them need no API key at all, including a local gateway that fronts a ChatGPT plan. For storing a key directly, see API key configuration. Never paste API keys into the aiswmm conversation.

Three ways in (one-line installer, Docker, or pip), compared side by side (what you get, prerequisites, reproducibility, when to pick each): choosing an install path. If something goes wrong, or you want a provider that needs no API key: install and troubleshooting.

Workflow

The workflow has three connected layers: execution, modeling memory, and controlled skill evolution. Natural-language requests can trigger reproducible SWMM actions; audited artifacts update human-readable and machine-readable memory; repeated patterns can produce skill-refinement proposals that still require human review and benchmark verification.

What a run can produce

  • generated or supplied SWMM input files such as model.inp

  • SWMM report and binary outputs such as .rpt and .out

  • manifests, command traces, QA summaries, and parsed peak-flow metrics

  • rainfall-runoff figures, calibration summaries, and fuzzy uncertainty summaries

  • audit records: experiment_provenance.json, comparison.json, and experiment_note.md

  • Obsidian-ready modelling notes and modelling-memory summaries

Validation snapshot

The repository includes runnable benchmarks and research previews with different evidence boundaries. The README keeps only the index; figures, commands, and boundary notes live in Validation evidence.

Path

What it shows

Evidence boundary

Information-loss-guided subcatchment partition

QGIS-to-Agentic SWMM preprocessing using entropy and fuzzy-similarity concepts from Zhang & Valeo's Journal of Hydrology paper

GIS preprocessing concept, not a calibrated SWMM performance claim

Raw GeoPackage-to-INP benchmark

Public TUFLOW GeoPackage layers converted into SWMM-ready artifacts, QA, and audit

Structured raw GIS path, not arbitrary CAD/GIS recognition

Prepared-input SWMM benchmark

External 40-subcatchment Tecnopolo model execution, plotting, and direct swmm5 comparison

Prepared INP validation path

Prior Monte Carlo uncertainty smoke

Tecnopolo HORTON parameter perturbation and hydrograph envelope preview

Prior uncertainty smoke, not calibration

Optional INP-derived raw adapter benchmark

Raw-like inputs extracted from a public SWMM fixture and rebuilt through the modular path

Adapter handoff check, not greenfield watershed generation

Cross-environment byte-identical reproducibility

A natural-language prompt (Run the Tecnopolo (Rome 1994) demo) drives the aiswmm chain (LLM agent → MCP → swmm-runner skill) to the same byte-identical model.out as bare swmm5, across macOS and Docker. v0.7.1 re-verification: the minimum natural-language prompt length for this chain is now 11 words, and the model.out SHA256 remains identical across the v0.7.0 → v0.7.1 minor revision.

SWMM execution-layer reproducibility, not agentic workflow reproducibility

LLM-driven dispatch + data-scarce urban modeling (SWMManywhere)

A single natural-language sentence referring only to a WGS84 bounding box drives the end-to-end SWMManywhere → SWMM → audit → network-map workflow on two independent regions (Greenwich Peninsula and NYC Midtown, ~1 km² each), with no shapefile, no DEM file, and no step-by-step tool instructions. Synthesis is the work of SWMManywhere (Imperial College London, BSD-3-Clause).

Agent-side plumbing for data-scarce baseline modeling; not a calibrated or validated network. Calibration is next-milestone scope.

Cross-session memory autonomous activation

An 11-word user prompt drove a complete Tecnopolo run on 2026-05-28 during which the LLM autonomously queried recall_session_history and recovered two prior Tecnopolo sessions from 12 days earlier: the first user-observable activation of the memory layer on a real production run.

Memory layer fires correctly and shapes planner decisions; staleness weighting and negative-precedent handling are next-milestone scope.

Examples: TUFLOW and Tecnopolo.

Audit and research memory

The audit layer consolidates artifacts, QA checks, and metric provenance into an Obsidian-compatible experiment note. This example catches a recorded peak-flow value that does not match the value re-parsed from the SWMM report source section.

The downstream modelling-memory layer can summarize audited run histories into recurring failure patterns, assumptions, missing evidence, QA issues, lessons learned, and controlled proposals for updating existing skills or creating new skills. Because skills drive the workflow, these proposals stay coupled to the current Agentic SWMM framework and still require human review and benchmark verification before acceptance.

More details: Experiment audit framework and Modeling memory and skill evolution.

Learn more about the ecosystem

Agentic SWMM is the SWMM engine within a larger effort toward a trustworthy, auditable, fully automated urban-hydrology modelling platform: a top-level agentic runtime orchestrating engine-specific automation on top of a shared data-to-model front end.

Project

Role in the ecosystem

Status

agentic-hydrology-platform

Orchestration layer: top-level agentic runtime that governs data, model selection, runs, and audit across the engine branches

LSTM catchment-modelling pipeline live; cross-engine (SWMM / MIKE+) orchestration in progress

SWMMCanada

Data & model-building layer: ingests and cleans GIS / open data and synthesises reliable model files; the shared front end for the engines. Agentic SWMM consumes it as an upstream INP source via fetch_swmm_from_canada (real municipal pipes for 8 Canadian cities)

SWMM today; extending to MIKE+ and InfoWorks ICM

Agentic SWMM (this repository)

SWMM engine: verification-first EPA SWMM automation (Skills + MCP + deterministic runs + audit)

Stable v0.9.3

Agentic-MIKE-Plus

MIKE+ engine: headless DHI MIKE+ automation (Skills + MCP), built on the Agentic SWMM design and the same method paper

Active development

Codex / Claude / OpenClaw / Hermes ready

Beyond its own aiswmm runtime, the Agentic SWMM workflow can be driven by external agent runtimes: Codex, Claude Code, OpenClaw, or Hermes. For an agent-orchestrated run, preload the agent/memory/ package and point the runtime at the top-level entry skill skills/swmm-end-to-end/SKILL.md, which decides which workflow path to take, which QA gates must pass, and when to stop rather than invent missing inputs.

Install the skills into any skills-aware runtime (Claude Code, Codex, OpenCode, …) with one command:

npx skills add Zhonghao1995/agentic-swmm-workflow

The skills carry the workflow and evidence contracts; pair them with the project install for the executable toolchain (aiswmm CLI, SWMM solver, MCP servers).

More details: Codex runtime path · OpenClaw execution path · Skill installation · MCP runtime integration.

Documentation map

Where collaborators can help

Contributions are welcome in additional SWMM case studies, stronger calibration and validation workflows, DEM / land-use / soil / drainage-asset workflows, new MCP tools, QA testing, tutorials, and interoperability with GIS, ML, and hydrologic toolchains.

Contact:

Citation

GitHub citation metadata is provided in CITATION.cff. Please cite the published article.

APA article (preferred)

Zhang, Z., & Valeo, C. (2026). Agentic SWMM: Auditable and reproducible stormwater modelling workflow with Agent Skills and Model Context Protocol. AI for Engineering, 1(1), 5. https://doi.org/10.3390/aieng1010005

APA repository

Zhang, Z., & Valeo, C. (2026). agentic-swmm-workflow [Computer software]. GitHub. https://github.com/Zhonghao1995/agentic-swmm-workflow

Available Tools

4 tools
swmm_compareC

Compare continuity error (%) between two SWMM .rpt files (e.g., GUI vs CLI).

ParametersJSON Schema
NameRequiredDescriptionDefault
rptYes
rpt2Yes

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description must disclose all behavioral traits. It states 'compare continuity error (%)' but does not explain what the comparison entails (e.g., subtraction, percentage difference), whether the files are read or modified, or any side effects. This is insufficient for an agent to understand the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no wasted words, but it lacks necessary details. It is front-loaded with the action and resource, but the brevity comes at the cost of completeness. A longer description with parameter mapping and output info would be more useful.

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?

Given no output schema and two required parameters, the description should explain what the tool returns (e.g., difference in continuity error) and clarify the role of each parameter. The current description does not provide enough context for an agent to use the tool correctly, especially when sibling tools exist but are not differentiated beyond basic purpose.

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

Parameters1/5

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

Schema coverage is 0%, so parameters have no descriptions. The tool description mentions 'two SWMM .rpt files' but does not map them to the parameters 'rpt' and 'rpt2'. The parameter names themselves are ambiguous (could be file paths or content). The example 'GUI vs CLI' does not clarify which parameter is which. This leaves the agent without enough information to correctly assign file paths.

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 specifies the verb 'Compare', the resource 'continuity error (%)', and the files 'SWMM .rpt files', with an example 'GUI vs CLI'. It effectively distinguishes from sibling tools like swmm_continuity (one file) and swmm_peak (peaks) by focusing on comparison of two files.

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 usage by mentioning 'two SWMM .rpt files' and the example 'GUI vs CLI', but it does not explicitly state when to use this tool versus alternatives (e.g., when comparing consistency) or when not to use it. No exclusions or alternatives are provided.

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

swmm_continuityC

Parse Runoff Quantity / Flow Routing continuity tables from a SWMM .rpt.

ParametersJSON Schema
NameRequiredDescriptionDefault
rptYes

TDQS

C2.6/5.0
Behavior2/5

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

With no annotations, the description carries full responsibility for behavioral disclosure. It only states the action (parse) without revealing side effects, error conditions, or performance implications. The agent cannot know if the operation is read-only, what happens on missing data, or any authentication needs. The minimal description leaves significant behavioral ambiguity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that is concise and front-loaded with the verb. However, it omits critical parameter semantics, which makes it less effective despite its brevity. A conciseness score of 3 reflects that it is not wasteful but fails to deliver essential information efficiently.

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

Completeness1/5

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

Given the tool has only one parameter with 0% schema coverage, no annotations, and no output schema, the description is severely incomplete. It fails to specify the parameter's meaning, return format, or edge cases. The agent lacks sufficient information to invoke the tool correctly without external knowledge of SWMM .rpt files.

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

Parameters1/5

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

Schema description coverage is 0%, so the description must compensate by explaining the 'rpt' parameter. The description mentions 'SWMM .rpt' but does not clarify whether the parameter expects a file path, file content, or a reference. The agent cannot infer the expected format (string could be path, base64, or raw text) from the description alone.

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's function: parsing Runoff Quantity and Flow Routing continuity tables from a SWMM .rpt file. The verb 'Parse' combined with the specific resource 'continuity tables' makes the purpose unambiguous. It distinguishes itself from sibling tools (swmm_compare, swmm_peak, swmm_run) which handle different operations.

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?

No guidance is provided on when to use this tool versus alternatives. The description only explains what the tool does, without mentioning prerequisites, context, or scenarios where this tool is preferred over siblings. Without such guidance, the agent must infer usage from tool names alone.

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

swmm_peakC

Parse peak flow and time-of-peak for a specific node/outfall from a SWMM .rpt. The node name must be supplied (no default).

ParametersJSON Schema
NameRequiredDescriptionDefault
rptYes
nodeYes

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It states the tool parses from a .rpt file, but does not reveal error behavior (e.g., node not found), whether it modifies files, or required file structure. Critical missing details for a parse tool.

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 very concise at two sentences, front-loaded with the main action. Every word adds value without redundancy.

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

Completeness3/5

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

For a simple parse tool with 2 parameters and no output schema, the description is adequate but could include details on expected .rpt format (e.g., SWMM 5 output) or behavior on missing node. It covers essentials but lacks robustness.

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 0%, but the description adds meaning: 'rpt' is the SWMM .rpt file, 'node' is the node/outfall name, and it must be supplied. This clarifies the purpose beyond the bare parameter names, though format or constraints are not specified.

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 explicitly states that the tool parses peak flow and time-of-peak from a SWMM .rpt file for a specific node/outfall. It is clear and specific, but does not differentiate from sibling tools like swmm_compare or swmm_run beyond the action.

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?

The description mentions that the node name must be supplied, but provides no guidance on when to use this tool vs alternatives (e.g., swmm_run for simulation, swmm_compare for comparisons) or when not to use it.

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

swmm_runA

Run swmm5 on an INP and write rpt/out + manifest.json into runDir. When 'node' is omitted, auto-detect the first entry of the .inp [OUTFALLS] section so the manifest's peak metric targets the real outfall.

ParametersJSON Schema
NameRequiredDescriptionDefault
inpYes
nodeNoOptional. If omitted, the first [OUTFALLS] entry of the .inp is used.
runDirYes
outNameNo
rptNameNo
memoriesAppliedNoOptional. List of modeling-memory entry ids whose parameters were programmatically applied to this run's inputs (e.g. ["cm-abc123"]). Recorded in manifest.json under 'memories_applied' for auditability. Omit when no memory was applied.

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries full burden. It discloses writing output files and auto-detecting outfall node when omitted, but lacks detail on side effects like file overwriting, error handling, or runtime. No contradiction with annotations 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 two sentences, front-loading the primary action and adding key auto-detection detail. Every word is purposeful, with no redundancy or fluff.

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?

Given the tool complexity, no output schema, and no annotations, the description omits important context such as return value format, error conditions, typical runtime, and details about output file structure. It is insufficient for fully understanding tool behavior.

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 coverage is low (33%), so description must compensate. It explains the 'node' parameter's auto-detection behavior and mentions 'inp' and 'runDir' by context. However, parameters like 'rptName' and 'outName' are not described beyond their presence in file names, leaving some semantics unclear.

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 runs swmm5 on an INP file and writes output files into runDir. It mentions specific outputs (rpt, out, manifest.json) and distinguishes from siblings like swmm_compare, swmm_continuity, and swmm_peak by focusing on simulation execution.

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 usage for running a simulation but does not explicitly state when to use this tool versus its siblings. No guidance on prerequisites or when not to use it is provided, though the sibling names offer indirect context.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv0.7.3
    • First observedswmm_compare
    • First observedswmm_continuity
    • First observedswmm_peak
    • First observedswmm_run

TDQS

B3.3/5.0
Disambiguation5/5

Each tool targets a distinct SWMM task: comparing reports, parsing continuity tables, extracting peak flows, and running simulations. No overlap or confusion.

Naming Consistency5/5

All tools follow a consistent 'swmm_<verb>' pattern, making them predictable and easy to differentiate.

Tool Count4/5

Four tools is reasonable for a focused SWMM analysis server, covering key operations without unnecessary clutter.

Completeness4/5

Covers core workflows (run, compare, parse continuity and peaks). Minor gaps like editing input files or exporting results are acceptable for this scope.

Maintenance

ActivityActive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    An MCP server that provides a toolbox for interacting with EPA SWMM stormwater models, enabling users to analyze model data and interpret results through LLM-driven tools. It assists stormwater modelers in understanding hydraulic systems and modeling behavior using natural language interfaces.
    18
    6
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP-native scientific skills for reproducible computational biology and AI-driven drug-discovery workflows. It combines deterministic scientific tools with an MCP server to give AI agents real computational capabilities.
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server for BIM-to-building-energy simulation workflows with IFC extraction, TEASER integration, scenario modeling, weather binding, and results export for downstream WAT/ROI analysis.
    MIT

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/Zhonghao1995/agentic-swmm-workflow'

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