Skip to main content
Glama

Query Any OpenFEMA Dataset

fema_query_dataset
Read-only

Generic OData query against any dataset in the OpenFEMA dataset catalog — the escape hatch for datasets the convenience tools do not cover (e.g., NfipPolicies, IndividualAssistanceHousingRegistrantsLargeDisasters, FemaWebDeclarationAreas, PublicAssistanceApplicants). Accepts raw OData filter, select, orderby, and pagination parameters. For NfipPolicies, use propertyState (not state) for the state and reportedZipCode for the ZIP code — it has no countyCode; always include a ZIP filter to avoid timeout. The dataset name must match the exact OpenFEMA entity name (case-sensitive, e.g., NfipClaims). Names missing from the catalog return an unknown_dataset error; a listed dataset OpenFEMA does not serve through the API returns dataset_not_served.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum records to return (1–10000, default 100).
filterNoOData $filter expression (e.g., "state eq 'TX' and declarationDate ge '2024-01-01T00:00:00.000Z'"). String values in single quotes.
offsetNoPagination offset (default 0).
selectNoComma-separated field names to return (e.g., "disasterNumber,state,declarationDate").
datasetYesOpenFEMA dataset entity name (case-sensitive, e.g., NfipPolicies, FemaWebDeclarationAreas, PublicAssistanceApplicants).
orderbyNoOData $orderby expression (e.g., "declarationDate desc").

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsNoRecords returned from the dataset. Field names depend on the queried dataset.
errorNoPresent when the call failed. Absent on success.
noticeNoGuidance on an empty page — filter advice when nothing matches, or the total and last valid offset when offset is at or past the end.
datasetNoThe dataset that was queried.
totalCountNoTotal matching records before pagination — exceeds returned_count when results were capped at the limit.
total_countNoTotal matching records before pagination.
returned_countNoNumber of records in this response.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `unknown_dataset`: The dataset name is not in the OpenFEMA dataset catalog, or OpenFEMA has no endpoint for it. `catalog_unavailable`: The OpenFEMA dataset catalog could not be read, so the dataset API version is unknown. `invalid_filter`: OpenFEMA rejected the filter expression — an unknown field, a value of the wrong type or range, or unparseable syntax. `invalid_select`: OpenFEMA rejected the select list — an unknown field or unparseable syntax. `invalid_orderby`: OpenFEMA rejected the orderby expression — an unknown field or unparseable syntax. `invalid_odata_syntax`: OpenFEMA could not parse the request and did not say whether filter, select, or orderby was at fault. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `unknown_dataset`: The dataset name is not in the OpenFEMA dataset catalog. `dataset_not_served`: The OpenFEMA dataset catalog lists the dataset, but OpenFEMA answers its API endpoint with a 404 page. `catalog_unavailable`: The OpenFEMA dataset catalog could not be read, so the dataset API version is unknown. `invalid_filter`: OpenFEMA rejected the filter expression — an unknown field, a value of the wrong type or range, or unparseable syntax. `invalid_select`: OpenFEMA rejected the select list — an unknown field or unparseable syntax. `invalid_orderby`: OpenFEMA rejected the orderby expression — an unknown field or unparseable syntax. `invalid_odata_syntax`: OpenFEMA could not parse the request and did not say whether filter, select, or orderby was at fault. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "unknown_dataset",
      -  "catalog_unavailable",
      -  "invalid_filter",
      -  "invalid_select",
      -  "invalid_orderby",
      -  "invalid_odata_syntax"
      -]New value: +[
      +  "unknown_dataset",
      +  "dataset_not_served",
      +  "catalog_unavailable",
      +  "invalid_filter",
      +  "invalid_select",
      +  "invalid_orderby",
      +  "invalid_odata_syntax"
      +]
  2. Changed4 schema fields changed
    • changedInput schema / properties / dataset / description
      Previous value: -"OpenFEMA v2 dataset entity name (case-sensitive, e.g., FimaNfipPolicies, FemaWebDeclarationAreas, PublicAssistanceApplicants)."New value: +"OpenFEMA dataset entity name (case-sensitive, e.g., NfipPolicies, FemaWebDeclarationAreas, PublicAssistanceApplicants)."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `unknown_dataset`: Dataset name not recognized by the OpenFEMA API. `invalid_filter`: OData filter expression could not be parsed by the API. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `unknown_dataset`: The dataset name is not in the OpenFEMA dataset catalog, or OpenFEMA has no endpoint for it. `catalog_unavailable`: The OpenFEMA dataset catalog could not be read, so the dataset API version is unknown. `invalid_filter`: OpenFEMA rejected the filter expression — an unknown field, a value of the wrong type or range, or unparseable syntax. `invalid_select`: OpenFEMA rejected the select list — an unknown field or unparseable syntax. `invalid_orderby`: OpenFEMA rejected the orderby expression — an unknown field or unparseable syntax. `invalid_odata_syntax`: OpenFEMA could not parse the request and did not say whether filter, select, or orderby was at fault. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "unknown_dataset",
      -  "invalid_filter"
      -]New value: +[
      +  "unknown_dataset",
      +  "catalog_unavailable",
      +  "invalid_filter",
      +  "invalid_select",
      +  "invalid_orderby",
      +  "invalid_odata_syntax"
      +]
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance when no results were found."New value: +"Guidance on an empty page — filter advice when nothing matches, or the total and last valid offset when offset is at or past the end."
  3. Changed6 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "dataset",
      +      "rows",
      +      "total_count",
      +      "returned_count"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / error
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Present when the call failed. Absent on success.",
      +  "properties": {
      +    "code": {
      +      "description": "JSON-RPC error code for this failure.",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "data": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "reason": {
      +          "description": "Machine-readable failure mode. Declared by this tool: `unknown_dataset`: Dataset name not recognized by the OpenFEMA API. `invalid_filter`: OData filter expression could not be parsed by the API. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "unknown_dataset",
      +            "invalid_filter"
      +          ],
      +          "type": "string"
      +        },
      +        "recovery": {
      +          "additionalProperties": {},
      +          "description": "Actionable next step for the caller.",
      +          "properties": {
      +            "hint": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "hint"
      +          ],
      +          "type": "object"
      +        },
      +        "retryable": {
      +          "description": "Whether retrying may succeed.",
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "message": {
      +      "description": "Human-readable description of what went wrong.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "code",
      +    "message"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "dataset",
      -  "rows",
      -  "total_count",
      -  "returned_count"
      -]
  4. Changed1 schema field changed
    • addedOutput schema / properties / totalCount
      Added value: +{
      +  "description": "Total matching records before pagination — exceeds returned_count when results were capped at the limit.",
      +  "type": "number"
      +}
  5. First observed

TDQS

A5/5.0
Behavior5/5

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

Annotations include readOnlyHint=true and openWorldHint=true, so the description isn't required to repeat read-only semantics. It adds valuable behavioral context: timeout risks ('always include a ZIP filter to avoid timeout'), error responses for invalid or unsupported datasets, and the case-sensitive nature of dataset names. These details go beyond what annotations convey, helping the agent anticipate edge cases.

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?

The description is dense but well-organized. It opens with the core purpose and 'escape hatch' framing, then lists example datasets, followed by specific OData usage tips, dataset-specific notes, and error behavior. Each sentence contributes unique information, and the most critical usage guidance appears early.

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?

Given the tool's generic nature, the description covers the essential knowledge an agent needs: how to specify the dataset, how to use OData parameters, special-case field mappings, and error handling. The output schema exists, so return format is not the description's responsibility. No critical gaps remain.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description enriches parameter semantics beyond the schema. It clarifies the dataset parameter must match the exact OpenFEMA entity name (case-sensitive), gives example filter expressions, and explains field-name quirks (propertyState vs state, reportedZipCode, absence of countyCode). This is crucial guidance that the schema alone does not provide.

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 clearly states the tool's purpose: 'Generic OData query against any dataset in the OpenFEMA dataset catalog'. It identifies the specific verb (query) and resource (any dataset). It also frames itself as an 'escape hatch' for datasets the convenience tools do not cover, explicitly listing examples, which distinguishes it from sibling convenience tools.

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?

The description explicitly tells when to use this tool: 'for datasets the convenience tools do not cover'. It provides dataset-specific guidance (e.g., NfipPolicies field names, ZIP filter requirement to avoid timeout) and explains error conditions (unknown_dataset, dataset_not_served). It even gives a rule about dataset name casing, making the usage conditions unambiguous.

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.