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, or a retired version, returns dataset_not_served. A page holds at most 100,000 characters of records; when records remain past it, next_offset is the offset to continue from.

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum records to return (1–10000, default 100). A page also stops at 100,000 characters of records; when either bound leaves matching records out, next_offset names the offset to continue from.
filterNoOData $filter expression (e.g., "state eq 'TX' and declarationDate ge '2024-01-01T00:00:00.000Z'"). String values in single quotes. For a list of values use field in ('a','b'): OpenFEMA rejects filters nested more than 100 levels deep (about 90 chained and/or comparisons) and request URLs past about 8,900 characters.
offsetNoPagination offset (default 0). Pass the previous page’s next_offset to continue.
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

NameRequiredDescriptionDefault
rowsNoRecords from offset onward, bounded by limit and by 100,000 characters of records. Field names depend on the queried dataset.
errorNoPresent when the call failed. Absent on success.
noticeNoPaging guidance — the offset to continue from and whether limit or the response budget ended the page, filter advice when nothing matches, or the total and last valid offset when offset is at or past the end — plus OpenFEMA’s notice when the dataset version is deprecated.
datasetNoThe dataset that was queried.
totalCountNoTotal matching records before pagination — exceeds returned_count when results were capped at the limit.
next_offsetNoOffset of the next page: offset plus returned_count. Present only while matching records remain past this page; pass it as offset to continue.
total_countNoTotal matching records before pagination.
returned_countNoNumber of records in this response.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • changedInput schema / properties / filter / description
      Previous value: -"OData $filter expression (e.g., \"state eq 'TX' and declarationDate ge '2024-01-01T00:00:00.000Z'\"). String values in single quotes."New value: +"OData $filter expression (e.g., \"state eq 'TX' and declarationDate ge '2024-01-01T00:00:00.000Z'\"). String values in single quotes. For a list of values use field in ('a','b'): OpenFEMA rejects filters nested more than 100 levels deep (about 90 chained and/or comparisons) and request URLs past about 8,900 characters."
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum records to return (1–10000, default 100)."New value: +"Maximum records to return (1–10000, default 100). A page also stops at 100,000 characters of records; when either bound leaves matching records out, next_offset names the offset to continue from."
    • changedInput schema / properties / offset / description
      Previous value: -"Pagination offset (default 0)."New value: +"Pagination offset (default 0). Pass the previous page’s next_offset to continue."
    • 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. `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."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, or the version is past its deprecation date and returns no records. `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. `request_too_long`: The request URL, mostly the filter after percent-encoding, is longer than the roughly 8,900 characters OpenFEMA accepts. `filter_too_complex`: The filter nests more than 100 levels deep, the most OpenFEMA allows; every and/or adds a level. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "unknown_dataset",
      -  "dataset_not_served",
      -  "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",
      +  "request_too_long",
      +  "filter_too_complex"
      +]
    • addedOutput schema / properties / next_offset
      Added value: +{
      +  "description": "Offset of the next page: offset plus returned_count. Present only while matching records remain past this page; pass it as offset to continue.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / notice / description
      Previous 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."New value: +"Paging guidance — the offset to continue from and whether limit or the response budget ended the page, filter advice when nothing matches, or the total and last valid offset when offset is at or past the end — plus OpenFEMA’s notice when the dataset version is deprecated."
    • changedOutput schema / properties / rows / description
      Previous value: -"Records returned from the dataset. Field names depend on the queried dataset."New value: +"Records from offset onward, bounded by limit and by 100,000 characters of records. Field names depend on the queried dataset."
  2. 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"
      +]
  3. 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."
  4. 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"
      -]
  5. 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"
      +}
  6. First observed

TDQS

A4.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description nevertheless adds real value beyond them: case-sensitive entity naming, the unknown_dataset and dataset_not_served error semantics, the 100,000-character page cap, and a timeout warning for NfipPolicies. It does not describe return payload shape, but with an output schema present that is a minor gap.

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?

Dense but front-loaded: the escape-hatch framing comes first, then dataset-specific traps, then error and pagination semantics. Every sentence carries operational information, though the NfipPolicies guidance could arguably live in the sibling tool that specializes in it.

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?

Covers the full decision surface for a generic query tool: when to reach for it, how to name the dataset, dataset-specific column traps, error outcomes, and pagination continuation. Return values are covered by the output schema, so nothing material is missing.

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%, so the baseline is 3, but the description goes well beyond the schema: it flags the propertyState-vs-state naming trap, requires a ZIP filter on NfipPolicies, explains next_offset propagation, and warns about OpenFEMA's nesting and URL-length limits, none of which appear in the schema text. These are exactly the traps that cause failed invocations.

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?

States a specific verb (query) and resource (any OpenFEMA dataset) and frames itself as the generic escape hatch, explicitly positioning it against the convenience tools it complements. An agent can immediately tell this apart from fema_search_nfip or fema_search_disasters.

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 a clear triggering condition (datasets the convenience tools do not cover) plus concrete example datasets (NfipPolicies, FemaWebDeclarationAreas) and a caveat about NfipPolicies column names and mandatory ZIP filtering. It stops short of naming the specific sibling tools an agent should prefer, so the routing is implied rather than spelled out.

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.