Skip to main content
Glama
Hydrata MCP Server

Hydrata MCP Server

Official
by Hydrata

Register an uploaded terrain

finalize_terrain_upload

Step 2 of a terrain import: register the PUT GeoTIFF as a Terrain and start the import.

Instructions

Step 2 of a terrain import: register the PUT GeoTIFF as a Terrain and start the import.

Needs a launch-level agent key (the import 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/).

Call this only after the presigned PUT returned 200. Creates the Terrain row (status creating) and queues the import chain — reproject to UTM, publish the layer + hillshade, style — which also seeds the project's six default boundary, friction, inflow, rainfall, building and mesh-region rows. Returns 202 with the terrain record; keep its id for get_terrain. A 400 UPLOAD_NOT_FOUND means no object is at staging_key: the PUT did not land (check its status code and Content-Type) — do not retry finalize until it has.

Heights the user says are on the ellipsoid (raw GPS or satellite heights): pass convert_to_egm2008=True so a sea-level (EGM2008) copy is made after the import. For a terrain already in Hydrata, use convert_terrain_datum instead.

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>",
      "staging_key": "<staging_key>"
    },
    "name": "finalize_terrain_upload"
  }
}

Input Schema

NameRequiredDescriptionDefault
titleNoTerrain title (default: the filename without .tif)
process_idNo`process_id` returned by presign_terrain_upload (pass it so the upload's progress record is reused; the API tolerates its absence)
project_idYesThe project ID
staging_keyYes`staging_key` returned by presign_terrain_upload
levels_datumNoThe datum the PERSON'S levels (study, survey, tailwater) are on, e.g. `AHD`, `NAVD88`, `Ordnance Datum Newlyn` or an EPSG vertical code (`EPSG:5711`). A project fact, separate from the terrain's own datum. Pass it when the user told you; if they did not, ask them, do not guess.
convert_to_egm2008NoTrue to have Hydrata also make a copy of the terrain shifted from ellipsoid heights to EGM2008 (sea-level) heights once the import is done. Only with vertical_datum_declared `ellipsoid`, the datum the user told you; the original stays as it is. Default false.
vertical_datum_declaredNoThe datum the user SAYS the heights are on: `ahd` (Australian Height Datum), `orthometric_egm2008` or `ellipsoid`. Pass it only when the user told you; if they did not, ask them, do not guess. Stored as the terrain's declared datum, which beats Hydrata's own inference. Omit when unknown.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.2.2
    • addedInput schema / properties / convert_to_egm2008
      Added value: +{
      +  "default": false,
      +  "description": "True to have Hydrata also make a copy of the terrain shifted from ellipsoid heights to EGM2008 (sea-level) heights once the import is done. Only with vertical_datum_declared `ellipsoid`, the datum the user told you; the original stays as it is. Default false.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / levels_datum
      Added value: +{
      +  "default": "",
      +  "description": "The datum the PERSON'S levels (study, survey, tailwater) are on, e.g. `AHD`, `NAVD88`, `Ordnance Datum Newlyn` or an EPSG vertical code (`EPSG:5711`). A project fact, separate from the terrain's own datum. Pass it when the user told you; if they did not, ask them, do not guess.",
      +  "type": "string"
      +}
    • changedInput schema / properties / vertical_datum_declared / description
      Previous value: -"TASK-4061: the datum the user SAYS the heights are on: `ahd` (Australian Height Datum), `orthometric_egm2008` or `ellipsoid`. Pass it only when the user told you; if they did not, ask them, do not guess. Stored as the terrain's declared datum, which beats Hydrata's own inference. Omit when unknown."New value: +"The datum the user SAYS the heights are on: `ahd` (Australian Height Datum), `orthometric_egm2008` or `ellipsoid`. Pass it only when the user told you; if they did not, ask them, do not guess. Stored as the terrain's declared datum, which beats Hydrata's own inference. Omit when unknown."
  2. Changed1 schema field changedv0.2.0
    • addedInput schema / properties / vertical_datum_declared
      Added value: +{
      +  "default": "",
      +  "description": "TASK-4061: the datum the user SAYS the heights are on: `ahd` (Australian Height Datum), `orthometric_egm2008` or `ellipsoid`. Pass it only when the user told you; if they did not, ask them, do not guess. Stored as the terrain's declared datum, which beats Hydrata's own inference. Omit when unknown.",
      +  "type": "string"
      +}
  3. First observedv0.2.1

TDQS

A4.6/5.0
Behavior4/5

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

Discloses far more than the annotations: auth failure mode (403 AGENT_LEVEL_INSUFFICIENT and the launch-key remedy), the side effects (creates the row in `creating`, queues the reproject/hillshade/style chain, seeds six default rows), the 202 response, and the 400 UPLOAD_NOT_FOUND meaning with an explicit do-not-retry instruction consistent with idempotentHint=false. Only minor gap is the absence of any rate/limit or partial-failure handling beyond the missing-object case.

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-loads the step and action, then sequences preconditions, effects, error handling and datum guidance in readable paragraphs. It is information-dense but a few sentences (e.g. the six seeded row types) are on the edge of more than an agent needs.

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 7-parameter mutation with an output schema, the definition covers trigger conditions, permission requirements, side effects, failure recovery, and the one non-obvious parameter choice; nothing needed 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, but the description adds genuine meaning: which datum field matters when the user reports ellipsoid heights, that convert_to_egm2008 makes a separate copy leaving the original intact, and the ask-don't-guess rule for user-declared datums.

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 ('register the PUT GeoTIFF as a Terrain and start the import') and positions itself as step 2 of the terrain import, which distinguishes it from presign_terrain_upload (step 1) and convert_terrain_datum by name.

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 precondition ('only after the presigned PUT returned 200'), an explicit alternative ('for a terrain already in Hydrata, use convert_terrain_datum'), and the key-level requirement with the exact error and where the user fixes it.

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