Skip to main content
Glama

us-drought-monitor-mcp-server

Query staged drought data

drought_dataframe_query
Read-only

Run one DuckDB read expression against staged drought tables, optionally ending with one semicolon. Get canvas_id from drought_get_timeseries or drought_compare_areas and inspect columns with drought_dataframe_describe. For every original row, SELECT * FROM the table ORDER BY row_id and follow next_offset until null. Arbitrary SQL pagination requires your own stable ORDER BY. Exact totals require SELECT COUNT(*).

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

Input Schema

NameRequiredDescriptionDefault
sqlYesOne DuckDB read expression with an optional terminal semicolon; staged tables only.
limitNoDefault 25 rows per page; values above 500 are clamped with disclosure.
offsetNoRows to skip in the stable ordered query.
canvas_idYesToken returned by a drought producer.

Output Schema

NameRequiredDescriptionDefault
capNoRequested maximum page rows.
rowsNoComplete projected values on this page.
errorNoPresent when the call failed. Absent on success.
shownNoComplete rows shown on the truncated page.
noticeNoEmpty-result or continuation guidance.
offsetNoRows skipped by this query.
columnsNoProjected column names in order.
has_moreNoWhether another page remains.
canvas_idNoSupplied canvas token.
truncatedNoMore query rows remain beyond this page.
limitNoticeNoDisclosure when the requested limit was clamped.
next_offsetNoContinue with this offset and identical SQL, or null.
countIsExactNoTrue only when the page exhausts the query at offset zero.
returnedCountNoNumber of rows returned.
tableMetadataNoBounded table identity and source provenance.
effectiveLimitNoEffective page ceiling after clamping to 500.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `canvas_unavailable`: Analytical provider is disabled or unavailable. `canvas_not_found`: Token is absent, expired or belongs to another tenant. `missing_table`: A named staged table is absent. `invalid_sql`: SQL cannot parse or bind. `sql_execution_error`: A data conversion or range expression fails. `sql_read_only`: SQL gate rejects a write, external read or system catalog. `staging_busy`: Two queries are already active in this process. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `canvas_unavailable`: Analytical provider is disabled or unavailable. `canvas_not_found`: Token is absent, expired or belongs to another tenant. `missing_table`: A named staged table is absent. `invalid_sql`: SQL cannot parse or bind. `sql_execution_error`: A data conversion or range expression fails. `sql_read_only`: SQL gate rejects a write, external read, system catalog or reserved metadata-view identifier. `staging_busy`: The analytical query queue is full or the admission wait expired. Other values are possible when a failure originates below the handler."
  2. Changed4 schema fields changed
    • changedInput schema / properties / limit / default
      Previous value: -100New value: +25
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum returned rows, clamped to 500 with disclosure and further bounded by complete response size."New value: +"Default 25 rows per page; values above 500 are clamped with disclosure."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `canvas_unavailable`: Analytical provider is disabled or unavailable. `canvas_not_found`: Token is absent, expired or belongs to another tenant. `missing_table`: A named staged table is absent. `invalid_sql`: SQL cannot parse or bind. `sql_execution_error`: A data conversion or range expression fails. `sql_read_only`: SQL gate rejects a write, external read or system catalog. `dataset_too_large`: Combined source metadata exceeds the query response budget. `query_row_too_large`: One projected row cannot fit a complete response. `staging_busy`: Two queries are already active in this process. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `canvas_unavailable`: Analytical provider is disabled or unavailable. `canvas_not_found`: Token is absent, expired or belongs to another tenant. `missing_table`: A named staged table is absent. `invalid_sql`: SQL cannot parse or bind. `sql_execution_error`: A data conversion or range expression fails. `sql_read_only`: SQL gate rejects a write, external read or system catalog. `staging_busy`: Two queries are already active in this process. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "canvas_unavailable",
      -  "canvas_not_found",
      -  "missing_table",
      -  "invalid_sql",
      -  "sql_execution_error",
      -  "sql_read_only",
      -  "dataset_too_large",
      -  "query_row_too_large",
      -  "staging_busy"
      -]New value: +[
      +  "canvas_unavailable",
      +  "canvas_not_found",
      +  "missing_table",
      +  "invalid_sql",
      +  "sql_execution_error",
      +  "sql_read_only",
      +  "staging_busy"
      +]
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond readOnlyHint/openWorldHint the description discloses real behavioral traits: only staged tables are reachable, a single statement with at most one terminal semicolon, arbitrary pagination needs a caller-supplied stable ORDER BY, and COUNT(*) is required for exact totals. These are non-obvious constraints that would otherwise cause silent wrong results.

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?

Every sentence carries load and the core action is front-loaded, with no filler or restatement of the title. The pagination sentence ('For every original row, SELECT * ... and follow next_offset until null') is compressed to the point of being slightly cryptic, which is the only structural weakness.

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 SQL-execution tool with an output schema already present, the description covers what remains: input sourcing, statement-shape limits, the cursor-based pagination loop, and when totals need aggregation. Nothing an agent needs 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 still adds value by naming where canvas_id comes from and by tying limit/offset to the stable-ordering and next_offset contract. It does not restate the 500-row clamp or the offset maximum, but that is already documented in the 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 first clause gives a specific verb and resource: run one DuckDB read expression against staged drought tables. It explicitly distinguishes itself from drought_dataframe_describe (schema inspection) and the producer tools (canvas_id source), so an agent can select it without opening any 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 states the prerequisite chain (get canvas_id from drought_get_timeseries or drought_compare_areas, inspect columns with drought_dataframe_describe) and routes schema discovery to the sibling instead of this tool. The pagination rule (follow next_offset until null) gives the agent the exact consumption protocol rather than leaving it to inference.

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.