Skip to main content
Glama

NEM Explorer (ScadaMiner)

export_data

DOWNLOAD or EXPORT query results as a private CSV file the user can open in Excel. THIS is the tool for "download it", "export it", "can I get this as a CSV/spreadsheet", "save this", "send me the data", or "give me the full data" — NOT share_artifact, which publishes to a public web page and will refuse a download request. Pass the read-only SELECT whose rows you want as sql (same rules and scan limits as execute_sql; to export a stored result use SELECT * FROM scratch.<scope>__<name> and include the same question_id you used there). Optionally pass a filename. The file holds up to 1000000 rows (and 24 MB), far more than execute_sql returns, because the rows go to the file and not back to you. So export the whole range the user asked for in ONE call and give them ONE link; do not split it by month or date range to stay under the execute_sql cap. Returns download_url — a private link, unlisted and not indexed, that expires in a day. Give it to the user and suggest they save the file. If the response carries truncated, the row cap was hit and the file is incomplete — say so, and offer to export the rest in date ranges. If it refuses with export too large, split exactly as it says: files_needed exports of at most max_rows_per_file rows, using suggested_split when given; do not guess a split of your own.

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": {
      "sql": "<sql>"
    },
    "name": "export_data"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesThe read-only SELECT whose rows become the file. Same rules and scan limits as `execute_sql`, but a much larger row cap (the rows go to the file, not back to you), so one call can export a full year of 5-minute data. Export the rows the user actually wants rather than a whole table. To export a stored result, this is just `SELECT * FROM scratch.<scope>__<name>`.
filenameNoOptional filename for the download, e.g. "ladbroke_constraints". The `.csv` suffix is added if absent, and unsafe characters are stripped.
question_idNoThe `question_id` from `start_question`. Required when `sql` references a `scratch.*` table, exactly as for `execute_sql` — it is what proves the stored result is yours.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations, it discloses the private/unlisted/not-indexed nature of the returned link and its one-day expiry, the 1,000,000-row and 24 MB caps, the `truncated` signal meaning an incomplete file, and the exact `export too large` failure mode with `files_needed`/`max_rows_per_file`/`suggested_split`. That is a materially richer behavioral picture than `readOnlyHint:false, destructiveHint:false, openWorldHint:true` alone and is consistent with those hints (the call materializes a file, so it is not a pure read).

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?

It is front-loaded with the core action and the negative example, then ordered by call lifecycle (how to call, what returns, what to do on truncation, what to do on refusal). It is long and occasionally redundant with the schema text, but nearly every sentence prevents a concrete agent mistake.

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 file-producing tool with no output schema, it covers everything an agent needs: input construction, the returned `download_url` field, link lifetime and privacy, capacity limits, the truncation branch, and the oversize-refusal branch. Nothing critical is left to inference.

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 100% and the description largely restates what the schema already documents (`sql`, `filename`, `question_id`). It does add one useful cross-reference — that a `scratch.*` export must carry the same `question_id` used with `execute_sql` — but the parameter-level meaning is mostly carried by the structured schema.

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 opens with a specific verb+artifact: "DOWNLOAD or EXPORT query results as a private CSV file the user can open in Excel." It immediately names the sibling it is not (`share_artifact`, which publishes publicly and refuses download requests), so an agent can disambiguate 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?

It supplies explicit trigger phrases ("download it", "save this", "give me the full data") and explicitly names the wrong-tool case with the reason it fails. It also distinguishes this from `execute_sql` by row-cap and destination, and instructs exporting the full range in one call rather than splitting to stay under the `execute_sql` cap.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.