Skip to main content
Glama

Query FEMA DataCanvas Table

fema_dataframe_query
Read-onlyIdempotent

Run a read-only SQL SELECT against a DataCanvas table staged by fema_search_nfip. Enables aggregation, GROUP BY, SUM/COUNT, time-series, and filtered analysis over the full NFIP claims result without re-fetching from the API. Call fema_dataframe_describe first to get the exact table name and column names needed for valid SQL. Only SELECT statements are allowed — DDL, DML, COPY, and file-reading functions are blocked.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSQL SELECT statement to run against the staged table. Use the table name from fema_dataframe_describe. Results are capped at the canvas row limit; append LIMIT/OFFSET to page through additional rows, or aggregate (GROUP BY, COUNT, SUM) to summarize the full set in one query. Example: "SELECT year_of_loss, COUNT(*) AS claims, SUM(amount_paid_building) AS total_building_paid FROM df_nfip_abc123 GROUP BY year_of_loss ORDER BY year_of_loss"
canvas_idYesCanvas ID from the fema_search_nfip response (the canvas_id field).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
capNoThe canvas row limit that was applied when the result was capped.
rowsNoResult rows from the query. May be capped at the canvas row limit — when the truncated enrichment field is set, page the remainder with LIMIT/OFFSET (see the notice guidance).
errorNoPresent when the call failed. Absent on success.
shownNoNumber of rows returned in this (capped) response.
noticeNoContinuation guidance when capped — how to page the remainder with LIMIT/OFFSET.
canvas_idNoCanvas ID that was queried — reuse for follow-up queries.
row_countNoNumber of rows in this response (may be capped at the canvas row limit).
truncatedNoTrue when the result was capped at the canvas row limit — more rows match than were returned.

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true; the description aligns with and reinforces those, adding no contradiction. It contributes beyond the annotations by spelling out exactly which statements are blocked ('DDL, DML, COPY, and file-reading functions'), which is genuinely useful operational context an agent wouldn't otherwise know. The row-cap behavior is mentioned but lives in the schema's query param rather than the description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences with no filler: purpose, capabilities, prerequisite, and restrictions. The core operation is front-loaded in the first clause, and every remaining sentence earns its place by adding non-obvious information (the describe-first prerequisite and the blocked-statement list).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a moderate-complexity SQL tool, the description covers purpose, usage context, the mandatory prerequisite, and safety restrictions. Return format is handled by the output schema and row-limit semantics are in the query param doc. It is complete enough that an agent can call it correctly; a small gap is not stating pagination/limit behavior in the description itself, though the schema covers it.

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 description coverage is 100%, and both the query and canvas_id params carry thorough inline descriptions (including an SQL example and row-limit guidance), so the schema does the heavy lifting. The description adds marginal value by steering agents to obtain table/column names from fema_dataframe_describe before writing valid SQL, but this is a light bonus on top of an already-complete schema — baseline 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Run a read-only SQL SELECT against a DataCanvas table') plus its capabilities (aggregation, GROUP BY, SUM/COUNT, time-series). It names the staging tool (fema_search_nfip) and the prerequisite (fema_dataframe_describe). It implies a distinction from fema_query_dataset via 'without re-fetching from the API', but never explicitly differentiates itself from that closest sibling, which is the main gap.

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?

Clearly defines the use case: local analytical queries over the full NFIP result set without re-fetching, and mandates a call sequence ('Call fema_dataframe_describe first'). What's missing is an explicit when-NOT-to-use statement or named alternative — for instance, when to prefer fema_query_dataset over querying the staged local table is left 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.

TDQS

A4.5/5.0
Disambiguation5/5

Each tool has a distinct purpose: search vs get, specific NFIP vs generic OData, and staging/query helpers. Descriptions clarify boundaries, minimizing confusion.

Naming Consistency5/5

All tools follow a consistent 'fema_<verb>_<target>' snake_case pattern (e.g., fema_search_disasters, fema_get_disaster). No mixed conventions or vague verbs.

Tool Count5/5

With 8 tools covering search, retrieval, NFIP claims, generic OData, and data staging, the count is well-scoped for the FEMA data domain without excess or insufficiency.

Completeness4/5

The set covers core workflows (disaster search/details, housing/PA assistance, NFIP search, generic query). Minor gap: detailed NFIP claim records require the generic query with timeout risks, but overall coverage is strong.