Skip to main content
Glama
Hydrata MCP Server

Hydrata MCP Server

Official
by Hydrata

Build a scenario's mesh and package

build_scenario

Builds a scenario's mesh and inputs only after showing the estimated triangle cost, then polls the build to completion and resumes any existing run.

Instructions

Build a scenario's package (mesh + inputs) after showing what it will cost, and poll until built.

Needs a launch-level agent key (a build can start AWS Batch); a read or draft key gets 403 AGENT_LEVEL_INSUFFICIENT — the user creates a launch key on the site's Agent keys page (/agents/).

Order of operations, so the number is shown before anything is spent:

  1. GET the scenario detail. A record with no boundary/computed_status keys is a non-member's read of a public project → refused: a build needs the EDITOR role.

  2. Re-call checks on latest_run (a re-POST is NOT deduplicated after built/complete — it would dispatch a duplicate build): no run → proceed; run created/building → resume polling, no POST; run built/queued/computing/processing/complete with latest_run_is_valid not false → return that state, no POST unless rebuild=true; run error/cancelled, or latest_run_is_valid false (the scenario was edited since the build) → proceed.

  3. Spend gates, each a refusal with outcome: "refused" and no POST: the scenario has no boundary or its boundary row has no features (the server would admit the build and fail it in make_package); the estimate is None (resolution is 0/unset); the estimate is above 100,000 triangles and confirm is not true — the refusal carries mesh_triangle_count_estimate and quote_estimate (the ONE pre-build price, labelled an estimate) and a say_to_user asking the person's yes: relay the number and the price and get the user's yes before confirm=true. confirm=true is a rule for you, not something the user does; never pass it on your own say-so. An estimate of 0 over a boundary WITH features is buildable and is reported, not refused.

  4. POST /projects//scenarios//build/. Every 4xx comes back verbatim as a normal result with http_status: 422 MESH_TOO_LARGE (error_code, estimate, ceiling, detail — the server's hard ceiling; coarsen resolution or shrink the boundary; no run was created), 409 COMPUTE_TARGET_UNAVAILABLE, 400/403/404. 409 UNREVIEWED_INPUTS (inputs you wrote that the user has not reviewed) answers outcome unreviewed_inputs with the unreviewed_inputs list and a ui_url to the scenario's review screen: give the user the link, poll get_scenario until its unreviewed_inputs is empty, then build again. A 409 WITHOUT an error_code is the dedup body ({status, run_id, detail}: a build is already in flight) — the tool resumes polling that run.

  5. On 202 poll the detail's computed_status (created → building → built | error), bounded by timeout_seconds.

Returns a COMPACT state, never the whole detail: outcome (built, error, cancelled, complete/queued/computing/processing for a run past the build, timed_out, or refused), computed_status, mesh_triangle_count_estimate, posted, the POST's build body + http_status when one was made, and the latest run's run_id, run_status, error_message, user_message, mesh_triangle_count. timed_out is normal (make_package re-downloads the terrain from S3 every build; minutes): call again with the same arguments — step 2 resumes polling the same run, it never POSTs twice — or cancel_run(run_id) if the run is stuck in created with no worker. error is terminal: error_message says why (fix the inputs, then call again — an errored latest run is rebuilt).

Units: resolution — on the SCENARIO and on every MeshRegion FEATURE — is a LENGTH in metres; ANUGA maximum_triangle_area = resolution²/2 (FloatField default 100, not nullable; 0 makes the estimate None), and the estimate prices both the same way. The smallest value becomes the raster cell size. A MeshRegion feature must carry resolution_units = m (features drawn in the map are marked automatically); an unmarked one makes the build answer 422 MESH_REGION_UNITS_UNMARKED, naming the conversion an operator runs.

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>",
      "scenario_id": "<scenario_id>"
    },
    "name": "build_scenario"
  }
}

Input Schema

NameRequiredDescriptionDefault
confirmNoRequired (true) when the estimate is above 100,000 triangles — the tool refuses first and tells you the number. Default false.
rebuildNotrue to dispatch a NEW build of a scenario whose latest run is already built/complete and still valid (default false: the tool returns that state instead of duplicating the build).
project_idYesThe project ID
scenario_idYesThe scenario ID from create_scenario
timeout_secondsNoHow long this call keeps polling 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 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 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 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 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?

Goes far beyond the annotations: discloses the launch-key requirement and the exact 403 AGENT_LEVEL_INSUFFICIENT failure, that builds spend money and are gated by a 100,000-triangle confirm, that a re-POST is not deduplicated, that 4xx bodies come back verbatim with http_status, and that timed_out is normal because make_package re-downloads terrain from S3. This is exactly the behavioral context annotations (readOnlyHint=false, idempotentHint=false) cannot express.

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 the one-sentence purpose, then organized as a numbered procedure, an error-code inventory, return shape, and units. Content-dense rather than padded, but it is long and the units paragraph on MeshRegion features sits at the tail where it is easy to miss.

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?

Despite an output schema existing, the description still enumerates the compact return fields (outcome, computed_status, posted, run_id, error_message) and interprets the outcome values, including that timed_out is not a failure. For a tool with spend gates, dedup hazards, and async polling, nothing an agent needs in order to call it correctly is missing.

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 100%, so the baseline is 3; the description adds real meaning on top — confirm is framed as a rule for the agent, never passed on its own say-so, and rebuild is explained in terms of the dedup/valid-run logic. timeout_seconds' ceiling rationale (edge cuts long silent calls) is also restated usefully, though it duplicates the schema text.

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?

States a specific verb and resource ("Build a scenario's package (mesh + inputs)") plus the polling behavior, and implicitly distinguishes itself from create_scenario/update_scenario by operating on an existing scenario's build pipeline. An agent can tell this apart from get_scenario or create_scenario 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?

Gives an explicit numbered order of operations: when to proceed, when to resume polling instead of POSTing, when to return existing state, and when to refuse. It names concrete alternatives in place (get_scenario for polling reviews, cancel_run(run_id) for a stuck run) and warns against re-POSTing.

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