Skip to main content
Glama
Hydrata MCP Server

Hydrata MCP Server

Official
by Hydrata

Attach an uploaded layer as a project input

attach_input_layer

Attaches an uploaded GeoJSON dataset to a project input row for boundary, friction, inflow, rainfall, building, mesh-region, or culvert layers by polling its upload execution.

Instructions

Attach a GeoJSON you uploaded to GeoNode as the project's boundary, friction, inflow, rainfall, building, mesh_region or culvert layer.

Only for a client that has a shell and an agent key. A connector agent with no shell (claude.ai) writes the layer inline with write_input_layer, or, for a file above the inline cap, gives the user the request_input_upload link instead.

The agent moves the bytes: first upload the GeoJSON yourself, with the same agent key, to GeoNode's upload endpoint at the site origin:

curl -sS -H 'Authorization: Bearer hk_...' -F "base_file=@/path/rainfall.geojson" https://<site>/api/v2/uploads/upload/

→ JSON with execution_id. Then call this tool with it. The tool polls GET /api/v2/resource-service/execution-status/<execution_id> (bounded by timeout_seconds; statuses ready → running → finished | failed), reads the new dataset's pk, and PATCHes it onto the project's DEFAULT row of that kind ('Boundary 01' … 'MeshRegion 01' — the six rows the terrain import seeds ~30 s after get_terrain reports ready; if the list is still empty the tool says so: run finalize_terrain_upload / wait for get_terrain first).

kind culvert (Hydraulic Structures; one two-point line per culvert, Inlet first, then Outlet): no culvert row is seeded by the terrain import, so a project with none answers no_default_row: write the culverts with write_input_layer, which makes the row. Hydrata converts every attached layer into the project's grid and the kind's table shape (single geometries, the_geom, the kind's own columns); attribute names are matched as they are, nothing is renamed for you (see write_input_layer). The culvert engine conveys flow through each culvert in a run (GPU lanes and localhost; the multi-core CPU lanes refuse a culvert scenario).

outcome is exactly one of: attached (row_id, gn_layer, dataset_pk and dataset_alternate — the WFS typename — of the CONVERTED layer the row now uses, source_dataset_pk — the dataset you uploaded — and every row id seen); timed_out (still importing: call again with the same arguments, except pass retry_execution_id as execution_id when the result carries one); upload_failed (the execution record, incl. its log, is returned verbatim — fix the file and upload again); no_default_row; no_dataset (finished but no resource was recorded). The PATCH is refused with a 400 if the dataset is not owned by you.

Every layer attached here is marked as written by your agent key and is UNREVIEWED until the user reviews it in their browser (the build refuses UNREVIEWED_INPUTS until then). INFLOWS: never invent an inflow location — no coordinates you made up, guessed or "placed plausibly". Import the location from the study's own files, or give the user the ui_url to draw it in the map; say in say_to_user that the inflow is unreviewed and where they check or draw it.

Refused, with no request made: kind breakline — Hydrata has no way to create a breakline layer, so attaching one would only pretend. Also refused without a request: an execution_id that is not the UUID the upload returned. One GeoJSON per kind: all of a kind's features travel in that one file. A rainfall polygon names its gauge in its data property — create that gauge with create_time_series under the exact same name.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project_id": "<project_id>",
      "kind": "<kind>",
      "execution_id": "<execution_id>"
    },
    "name": "attach_input_layer"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindYesWhich input the uploaded layer is: boundary, friction, inflow, rainfall, building, mesh_region or culvert ('structure' is a deprecated alias of building). breakline is refused (see below).
project_idYesThe project ID
execution_idYes`execution_id` returned by your multipart POST to <origin>/api/v2/uploads/upload/
timeout_secondsNoHow long this call keeps polling the upload before it returns `timed_out` (default 110, ceiling 110: hydrata.com's edge cuts a longer silent call). 0 = one status read, no waiting.
poll_interval_secondsNoSeconds between polls (default 5)

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.2.4
    • changedInput schema / properties / timeout_seconds / default
      Previous value: -180New value: +110
    • changedInput schema / properties / timeout_seconds / description
      Previous value: -"How long this call keeps polling the upload before it returns `timed_out` (default 180, ceiling 200 — claude.ai cuts a tool call at 240 s). 0 = one status read, no waiting."New value: +"How long this call keeps polling the upload before it returns `timed_out` (default 110, ceiling 110: hydrata.com's edge cuts a longer silent call). 0 = one status read, no waiting."
  2. Changed2 schema fields changedv0.2.0
    • changedInput schema / properties / timeout_seconds / default
      Previous value: -240New value: +180
    • changedInput schema / properties / timeout_seconds / description
      Previous value: -"How long this call keeps polling the upload before it returns `timed_out` (default 240, ceiling 280 — the prod /mcp/ proxy cuts a call at 300 s). 0 = one status read, no waiting."New value: +"How long this call keeps polling the upload before it returns `timed_out` (default 180, ceiling 200 — claude.ai cuts a tool call at 240 s). 0 = one status read, no waiting."
  3. First observedv0.2.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare the safety profile (not read-only, not destructive, non-idempotent, closed-world); the description adds real operational context beyond them: the polling endpoint and status machine, the timeout ceiling, ownership-based 400 refusal, the unreviewed-input state that blocks builds, and the culvert CPU-lane restriction. It also discloses what the user must subsequently do in the browser.

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?

Front-loaded with purpose and the shell/agent-key constraint, then ordered as workflow → outcomes → safety caveats → refusals → per-kind rules, so the reader can stop early. It is long and dense with parentheticals and caps, but almost every sentence carries load-bearing information for a genuinely complex tool.

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?

For a 5-parameter tool with a mutation, polling, and conversion pipeline, the description covers prerequisites, the exact upload step, the polling contract, every outcome string, ownership failure, unreviewed state, and per-kind edge cases. With an output schema present, it correctly spends its words on workflow and caveats rather than return-value field listings.

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 coverage is already 100%, so the baseline is 3, but the description adds meaning the schema cannot: what each kind actually becomes (converted grid, the kind's own columns), the culvert two-point Inlet/Outlet geometry convention, the rainfall `data` gauge-name linkage to create_time_series, and the retry_execution_id continuation path. It stops short of explaining poll_interval_seconds beyond the schema, which keeps it at 4 rather than 5.

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 first sentence states a specific verb and resource (attach an uploaded GeoJSON as the project's boundary/friction/inflow/rainfall/building/mesh_region/culvert layer) and immediately scopes it against write_input_layer and request_input_upload. An agent can distinguish it from every named sibling without opening a schema.

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?

Explicitly states the precondition (client with a shell and an agent key), names the alternatives for shell-less clients (write_input_layer, request_input_upload), gives the exact upload endpoint and curl invocation, and enumerates the refusal cases (breakline, non-UUID execution_id, culvert with no seeded row). Nothing is left to inference.

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