Skip to main content
Glama
Oceanum MCP

Oceanum MCP

Official
by oceanum-io

Datamesh Export Query

datamesh_export_query
Idempotent

Export full query results to a download URL or local file so data stays out of the conversation. Fetch large Datamesh results safely out-of-band.

Instructions

Export the FULL result of a query — the data never enters the conversation.

Behavior depends on how the server is running:

  • Hosted (http/sse): returns a time-limited, self-authenticating gateway download_url (choose format via format); path is ignored. Fetch the URL out-of-band — it needs no credential, so treat it as a secret. When the response includes expires_at or max_uses, fetch it before expires_at and at most max_uses times. Refused above the hosted export cap, and for limit combined with time_resolution/aggregate_operations.

  • Local (stdio): writes the result to the local file path (required) and returns that path. Gridded datasets stream to NetCDF; tabular results write Parquet or CSV, as do datasets small enough to flatten into a table (e.g. point time series). Refused up front if the result exceeds the local export cap or the destination's free disk space. With limit plus time_resolution/aggregate_operations, the last N resampled steps are written.

The size is checked before anything is exported, whether or not stage_query was called. An export writing more than 1 GB in the chosen format (CSV text is about 3x; locally, a dataset written as CSV/Parquet is sized as the flattened table, and a limited one on its limited slice) is refused unless confirm_size_bytes equals that size (on hosted, within 5%, since the download stage is sized separately): ask the user first. The refusal states the exact value. The server cannot see whether the user was asked, so this is advisory: it forces an explicit, size-aware step. The export caps limit the transfer, not the size of each file: never split a refused request into parts to get under them.

A variable given as the exact CF standard_name of exactly one of the datasource's variables (e.g. "sea_surface_wave_significant_height" for "hs") is resolved to that variable; the response then includes resolved_variables ({requested: used}) and echoes the resolved names.

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": {
      "datasource_id": "<datasource_id>"
    },
    "name": "datamesh_export_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
crsNoCRS for filter coordinates and returned data (EPSG code or CRS string).
bboxNoBounding box [xmin, ymin, xmax, ymax] in WGS84 (or crs units if crs is set).
pathNoLocal (stdio) destination file path (required on stdio; parent directories are created; confined to OCEANUM_MCP_EXPORT_DIR when set). Ignored on hosted servers, which return a download URL.
limitNoKeep only the last N records (Datamesh semantics: the last N steps along time/ensemble). Combined with time_resolution or aggregate_operations it is applied AFTER resampling/aggregation (by this server, not sent to Datamesh), so stage_query sizes the unlimited result as an upper bound; hosted export_query refuses that combination.
timesNoDiscrete times to select (series selection). Mutually exclusive with time_start/time_end.
formatNoOutput format: netcdf (datasets), parquet or csv (tabular, or datasets small enough to flatten into a table such as point time series). Defaults by container: dataset -> netcdf, tabular -> parquet.
levelsNoDiscrete vertical levels to select (series selection). Mutually exclusive with level_min/level_max.
time_endNoISO 8601 end of a time range. Open-ended if omitted.
level_maxNoMaximum vertical level of a range.
level_minNoMinimum vertical level of a range.
overwriteNoOverwrite an existing local file (default false). Local export only.
result_idNoA handle from stage_query: replays exactly that query (and is cited in its provenance). Pass it with the same datasource_id and no other query parameters.
variablesNoList of variable names to select (e.g. ["temperature", "salinity"]).
time_startNoISO 8601 start of a time range (e.g. "2023-01-01T00:00:00Z"). Open-ended if omitted.
level_interpNoInterpolation for level series selection: nearest or linear.
coord_filtersNoAdditional coordinate selections, e.g. [{"coord": "station", "values": ["A1", "B2"]}].
datasource_idYesThe datasource to query.
time_resampleNoResampling method when time_resolution is set: mean, nearest, or linear.
time_resolutionNoDownsample a time range server-side to this resolution (pandas frequency string, e.g. "1h", "6h", "1D", "7D", or "30D" for roughly monthly). Drastically shrinks long time series. Monthly/quarterly/yearly calendar aliases (MS, ME, QS, YS) are not supported until a Datamesh engine fix ships: use "30D", "90D" or "365D". Finer than 1 minute is refused.
geofilter_interpNoInterpolation for feature selection: nearest or linear (default linear).
aggregate_spatialNoAggregate over spatial dimensions (default true).
geofilter_featureNoGeoJSON Feature object (Point, MultiPoint, or Polygon geometry) for spatial selection/interpolation. Mutually exclusive with bbox.
aggregate_temporalNoAggregate over the temporal dimension (default true).
confirm_size_bytesNoRequired for results above 1 GB: the size in bytes, in the chosen format, the user has agreed to export (stage_query's size_bytes for the default format, or export_size_bytes from a refusal). Must match exactly (within 5% on hosted servers). Ignored for exports of 1 GB or less.
aggregate_operationsNoAggregations to apply after filtering: mean, min, max, std, sum.
geofilter_resolutionNoMaximum spatial resolution for downsampling, in CRS units.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.0
    • addedInput schema / properties / result_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "A handle from stage_query: replays exactly that query (and is cited in its provenance). Pass it with the same datasource_id and no other query parameters."
      +}
  2. Changed1 schema field changedv0.6.0
    • addedInput schema / properties / confirm_size_bytes
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Required for results above 1 GB: the size in bytes, in the chosen format, the user has agreed to export (stage_query's size_bytes for the default format, or export_size_bytes from a refusal). Must match exactly (within 5% on hosted servers). Ignored for exports of 1 GB or less."
      +}
  3. First observedv0.5.2

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only say it is non-read-only, idempotent, non-destructive and open-world; the description goes far beyond that, disclosing that local mode writes files, that hosted mode returns a time-limited self-authenticating URL that should be treated as a secret, that expires_at/max_uses bound fetches, and that size is checked before anything is exported. It also explains that the confirm_size_bytes gate is advisory because the server cannot see whether the user was asked — a genuinely non-obvious behavioral trait.

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 one-line purpose, then splits transport-specific behavior into two tight bullets and follows with cross-cutting rules. It is long and the size-cap paragraph is dense, but nearly every sentence carries operational information rather than filler.

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 26-parameter tool with an output schema and full annotation coverage, the description covers the cross-cutting concerns the structured fields cannot: transport-dependent behavior, refusal conditions, the size-confirmation handshake, and the anti-pattern of splitting refused requests. Nothing an agent needs to invoke it correctly appears 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 real meaning on top: `format` applies only to hosted downloads, `limit` interacts with time_resolution/aggregate_operations differently per transport, and confirm_size_bytes must be within 5% on hosted. The standard_name resolution rule for `variables` (with resolved_variables echo) is semantics the schema does not express at all.

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?

Opens with a specific verb and resource — 'Export the FULL result of a query' — plus the key scope differentiator that the data never enters the conversation, which separates it from datamesh_query_data. An agent can tell instantly what this tool produces and how it differs from an in-conversation query.

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

Usage Guidelines4/5

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

Gives explicit conditional guidance: hosted vs local transport determines whether `path` is used or ignored, and it states precise refusal conditions (hosted export cap, limit combined with time_resolution/aggregate_operations, local disk space, >1 GB without confirm_size_bytes). It does not explicitly name a sibling as the alternative for small results, leaving that routing to inference from the 'FULL result' framing.

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