Query Any OpenFEMA Dataset
fema_query_datasetGeneric 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.
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": {
"dataset": "<dataset>"
},
"name": "fema_query_dataset"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | 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. | |
| filter | No | 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. | |
| offset | No | Pagination offset (default 0). Pass the previous page’s next_offset to continue. | |
| select | No | Comma-separated field names to return (e.g., "disasterNumber,state,declarationDate"). | |
| dataset | Yes | OpenFEMA dataset entity name (case-sensitive, e.g., NfipPolicies, FemaWebDeclarationAreas, PublicAssistanceApplicants). | |
| orderby | No | OData $orderby expression (e.g., "declarationDate desc"). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | Records from offset onward, bounded by limit and by 100,000 characters of records. Field names depend on the queried dataset. | |
| error | No | Present when the call failed. Absent on success. | |
| notice | No | 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. | |
| dataset | No | The dataset that was queried. | |
| totalCount | No | Total matching records before pagination — exceeds returned_count when results were capped at the limit. | |
| next_offset | No | Offset of the next page: offset plus returned_count. Present only while matching records remain past this page; pass it as offset to continue. | |
| total_count | No | Total matching records before pagination. | |
| returned_count | No | Number of records in this response. |