Server definition
- Hash
- sha256:f7e365e2a347fcf04fd4a985c548337a32da221be29276dad2a0e074c1e2fada
- What it is
- What a remote MCP server returned when asked what it offers: 8 tools
The blob, as servednamed by its sha256
{
"instructions": "Start with fema_search_disasters and use the disaster number to join declarations with public and housing assistance. For NFIP claims, supply a state filter; when results include a canvas_id, inspect columns with fema_dataframe_describe before querying with fema_dataframe_query. Use fema_query_dataset for any other dataset in the OpenFEMA catalog.",
"tools": [
{
"description": "List tables and column schemas on a DataCanvas staged by fema_search_nfip. Call this before fema_dataframe_query to discover the exact table name, column names, and DuckDB data types needed to write valid SQL. Row count reflects what was actually staged — check truncated in the fema_search_nfip response to know whether the canvas holds the full matching set.",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"canvas_id": {
"description": "Canvas ID from the fema_search_nfip response.",
"pattern": "^[A-Za-z0-9_-]{10}$",
"type": "string"
}
},
"required": [
"canvas_id"
],
"type": "object"
},
"name": "fema_dataframe_describe",
"outputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"tables",
"canvas_id"
]
},
{
"required": [
"error"
]
}
],
"properties": {
"canvas_id": {
"description": "Canvas ID that was described — pass to fema_dataframe_query.",
"type": "string"
},
"error": {
"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: `canvas_not_found`: The canvas_id does not correspond to an active canvas session. `canvas_unavailable`: DataCanvas is disabled on this deployment (CANVAS_PROVIDER_TYPE is not set to duckdb). Other values are possible when a failure originates below the handler.",
"examples": [
"canvas_not_found",
"canvas_unavailable"
],
"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"
},
"tables": {
"description": "All tables and views available on this canvas.",
"items": {
"additionalProperties": false,
"description": "A single registered table or view on the canvas.",
"properties": {
"columns": {
"description": "All columns in this table, in schema order.",
"items": {
"additionalProperties": false,
"description": "A single column in the table.",
"properties": {
"name": {
"description": "Column name — use in SELECT, WHERE, GROUP BY, and ORDER BY clauses.",
"type": "string"
},
"nullable": {
"description": "True when the column can contain NULL values. Absent when nullability is unknown.",
"type": "boolean"
},
"type": {
"description": "DuckDB SQL data type (e.g., VARCHAR, DOUBLE, INTEGER, BOOLEAN).",
"type": "string"
}
},
"required": [
"name",
"type"
],
"type": "object"
},
"type": "array"
},
"kind": {
"description": "Object type: \"table\" for a registered data table, \"view\" for a derived view.",
"type": "string"
},
"name": {
"description": "Table or view name — use this exact string in SQL FROM clauses.",
"type": "string"
},
"row_count": {
"description": "Total rows in this table — the full staged result set, not the inline preview count.",
"type": "number"
}
},
"required": [
"name",
"kind",
"row_count",
"columns"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
},
{
"description": "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.",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"canvas_id": {
"description": "Canvas ID from the fema_search_nfip response (the canvas_id field).",
"pattern": "^[A-Za-z0-9_-]{10}$",
"type": "string"
},
"query": {
"description": "SQL 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\"",
"type": "string"
}
},
"required": [
"canvas_id",
"query"
],
"type": "object"
},
"name": "fema_dataframe_query",
"outputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"rows",
"row_count",
"canvas_id"
]
},
{
"required": [
"error"
]
}
],
"properties": {
"canvas_id": {
"description": "Canvas ID that was queried — reuse for follow-up queries.",
"type": "string"
},
"cap": {
"description": "The canvas row limit that was applied when the result was capped.",
"type": "number"
},
"error": {
"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: `sql_execution_error`: A SELECT fails while converting or calculating values in the staged data. `canvas_not_found`: The canvas_id does not correspond to an active canvas session. `canvas_unavailable`: DataCanvas is disabled on this deployment (CANVAS_PROVIDER_TYPE is not set to duckdb). `invalid_query`: The SQL statement is not a valid SELECT, references a non-existent table or column, or uses blocked operations. Other values are possible when a failure originates below the handler.",
"examples": [
"sql_execution_error",
"canvas_not_found",
"canvas_unavailable",
"invalid_query"
],
"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"
},
"notice": {
"description": "Continuation guidance when capped — how to page the remainder with LIMIT/OFFSET.",
"type": "string"
},
"row_count": {
"description": "Number of rows in this response (may be capped at the canvas row limit).",
"type": "number"
},
"rows": {
"description": "Result 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).",
"items": {
"additionalProperties": {},
"description": "A single result row — keys are column names from the SELECT, values are the computed data.",
"propertyNames": {
"type": "string"
},
"type": "object"
},
"type": "array"
},
"shown": {
"description": "Number of rows returned in this (capped) response.",
"type": "number"
},
"truncated": {
"description": "True when the result was capped at the canvas row limit — more rows match than were returned.",
"type": "boolean"
}
},
"type": "object"
}
},
{
"description": "Fetch all designated-area rows for a specific FEMA disaster by disaster number (e.g., 4781). Returns every county/municipality designated under the declaration along with programs activated, incident period, and state info. Use fema_search_disasters to find disaster numbers. The returned disaster_number chains to fema_get_public_assistance and fema_get_housing_assistance.",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"disaster_number": {
"description": "FEMA disaster number (e.g., 4781). Obtain from fema_search_disasters.",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"type": "integer"
}
},
"required": [
"disaster_number"
],
"type": "object"
},
"name": "fema_get_disaster",
"outputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"disaster_number",
"title",
"state",
"incident_type",
"declaration_type",
"declaration_date",
"ia_declared",
"pa_declared",
"hm_declared",
"designated_areas",
"designated_area_count"
]
},
{
"required": [
"error"
]
}
],
"properties": {
"declaration_date": {
"description": "ISO 8601 date the declaration was signed.",
"type": "string"
},
"declaration_type": {
"description": "Declaration type: DR (major disaster), EM (emergency), or FM (fire management).",
"type": "string"
},
"designated_area_count": {
"description": "Total number of designated areas in this declaration.",
"type": "number"
},
"designated_areas": {
"description": "All counties/municipalities designated for assistance under this declaration.",
"items": {
"additionalProperties": false,
"description": "A single designated area entry.",
"properties": {
"area": {
"description": "Name of the designated county or municipality.",
"type": "string"
},
"fips_county_code": {
"description": "3-digit county FIPS code. Absent when not returned.",
"type": "string"
},
"fips_state_code": {
"description": "2-digit state FIPS code. Absent when not returned.",
"type": "string"
}
},
"required": [
"area"
],
"type": "object"
},
"type": "array"
},
"disaster_number": {
"description": "FEMA disaster number — use as the chain key for PA and housing assistance tools.",
"type": "number"
},
"error": {
"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: `not_found`: No declaration found with the given disaster number. Other values are possible when a failure originates below the handler.",
"examples": [
"not_found"
],
"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"
},
"hm_declared": {
"description": "True when Hazard Mitigation grants were declared.",
"type": "boolean"
},
"ia_declared": {
"description": "True when the Individuals and Households Program (IHP) was declared — indicates IA housing/personal grants are available.",
"type": "boolean"
},
"incident_begin_date": {
"description": "ISO 8601 start date of the incident. Absent when not recorded.",
"type": "string"
},
"incident_end_date": {
"description": "ISO 8601 end date of the incident. Absent for ongoing or unrecorded incidents.",
"type": "string"
},
"incident_type": {
"description": "Type of incident (e.g., Flood, Hurricane, Severe Storm).",
"type": "string"
},
"pa_declared": {
"description": "True when Public Assistance (infrastructure recovery grants) was declared.",
"type": "boolean"
},
"state": {
"description": "Two-letter state/territory code.",
"type": "string"
},
"title": {
"description": "Official declaration title (e.g., \"SEVERE STORMS AND FLOODING\").",
"type": "string"
}
},
"type": "object"
}
},
{
"description": "Retrieve Individual Assistance (IA) housing data for a disaster by disaster number. Returns owner and/or renter breakdowns by county and ZIP code — valid registrations, total approved IHP amounts, repair/rental amounts, and inspection data. Use type to select owners, renters, or both (default). Use disaster_number from fema_search_disasters.",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"disaster_number": {
"description": "FEMA disaster number. Obtain from fema_search_disasters. Numbers above 32767 match no declaration.",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"type": "integer"
},
"limit": {
"default": 100,
"description": "Maximum records per dataset to return (default 100).",
"maximum": 1000,
"minimum": 1,
"type": "integer"
},
"offset": {
"default": 0,
"description": "Pagination offset (default 0).",
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
},
"state": {
"description": "Two-letter state code to narrow results when a disaster spans multiple states.",
"maxLength": 2,
"minLength": 2,
"type": "string"
},
"type": {
"default": "both",
"description": "Which housing assistance dataset to query: owners, renters, or both (default).",
"enum": [
"owners",
"renters",
"both"
],
"type": "string"
}
},
"required": [
"disaster_number"
],
"type": "object"
},
"name": "fema_get_housing_assistance",
"outputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"owners",
"renters",
"owners_count",
"renters_count"
]
},
{
"required": [
"error"
]
}
],
"properties": {
"error": {
"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: `invalid_state`: The state parameter is not a valid 2-letter US state/territory code. `not_found`: The disaster number is above 32767, the highest number OpenFEMA holds, so no declaration exists. `no_results`: No IA housing records found for this disaster. Other values are possible when a failure originates below the handler.",
"examples": [
"invalid_state",
"not_found",
"no_results"
],
"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"
},
"notice": {
"description": "Paging guidance when offset is at or past the end of a queried dataset — names its total and last valid offset.",
"type": "string"
},
"owners": {
"description": "Homeowner (HousingAssistanceOwners) records. Empty when type is \"renters\" or no owner data exists.",
"items": {
"additionalProperties": false,
"description": "Homeowner housing assistance aggregated by county and ZIP for one disaster.",
"properties": {
"approved_for_fema_assistance": {
"description": "Number of homeowner registrations approved for any FEMA assistance; 0 when none were. Absent when not reported.",
"type": "number"
},
"city": {
"description": "City name. Absent when not recorded.",
"type": "string"
},
"county": {
"description": "County name. Absent when not recorded.",
"type": "string"
},
"disaster_number": {
"description": "FEMA disaster number this record belongs to.",
"type": "number"
},
"other_needs_amount": {
"description": "Other needs assistance (personal property, transportation, etc.) in USD; 0 when none was approved. Absent when not reported.",
"type": "number"
},
"rental_amount": {
"description": "Rental assistance granted in USD; 0 when none was. Absent when not reported.",
"type": "number"
},
"repair_replace_amount": {
"description": "Home repair and replacement assistance in USD; 0 when none was approved. Absent when not reported.",
"type": "number"
},
"state": {
"description": "Two-letter state code. Absent when not recorded.",
"type": "string"
},
"total_approved_ihp_amount": {
"description": "Total Individuals and Households Program (IHP) assistance approved in USD; 0 when none was. Absent when not reported.",
"type": "number"
},
"valid_registrations": {
"description": "Number of valid IA registrations from homeowners in this area. Absent when not reported.",
"type": "number"
},
"zip_code": {
"description": "5-digit ZIP code; 00000 when OpenFEMA files the records under no ZIP code. Absent when not recorded.",
"type": "string"
}
},
"required": [
"disaster_number"
],
"type": "object"
},
"type": "array"
},
"owners_count": {
"description": "Total owner records available before the per-dataset limit.",
"type": "number"
},
"renters": {
"description": "Renter (HousingAssistanceRenters) records. Empty when type is \"owners\" or no renter data exists.",
"items": {
"additionalProperties": false,
"description": "Renter housing assistance aggregated by county and ZIP for one disaster.",
"properties": {
"approved_for_fema_assistance": {
"description": "Number of renter registrations approved for any FEMA assistance; 0 when none were. Absent when not reported.",
"type": "number"
},
"city": {
"description": "City name. Absent when not recorded.",
"type": "string"
},
"county": {
"description": "County name. Absent when not recorded.",
"type": "string"
},
"disaster_number": {
"description": "FEMA disaster number this record belongs to.",
"type": "number"
},
"other_needs_amount": {
"description": "Other needs assistance in USD; 0 when none was approved. Absent when not reported.",
"type": "number"
},
"rental_amount": {
"description": "Rental assistance granted in USD; 0 when none was. Absent when not reported.",
"type": "number"
},
"state": {
"description": "Two-letter state code. Absent when not recorded.",
"type": "string"
},
"total_approved_ihp_amount": {
"description": "Total IHP assistance approved for renters in USD; 0 when none was. Absent when not reported.",
"type": "number"
},
"valid_registrations": {
"description": "Number of valid IA registrations from renters in this area. Absent when not reported.",
"type": "number"
},
"zip_code": {
"description": "5-digit ZIP code; 00000 when OpenFEMA files the records under no ZIP code. Absent when not recorded.",
"type": "string"
}
},
"required": [
"disaster_number"
],
"type": "object"
},
"type": "array"
},
"renters_count": {
"description": "Total renter records available before the per-dataset limit.",
"type": "number"
},
"totalCount": {
"description": "Total owner + renter records available before the per-dataset limit — exceeds the returned count when either dataset was capped.",
"type": "number"
}
},
"type": "object"
}
},
{
"description": "Retrieve Public Assistance (PA) funded project records for a disaster or state — shows where federal recovery money was obligated. Returns applicant, damage category, project size and status, federal share obligated, and total obligated amounts. Either disaster_number or state must be provided. Use disaster_number (from fema_search_disasters) to scope to a single declaration, or state to browse all PA projects for a state. PA projects are created only when the PA program is declared (pa_declared: true on the disaster).",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"county": {
"description": "Filter by county name substring.",
"type": "string"
},
"disaster_number": {
"description": "FEMA disaster number to scope results to a single declaration. Numbers above 32767 match no declaration.",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"type": "integer"
},
"limit": {
"default": 100,
"description": "Maximum number of projects to return (1–1000, default 100).",
"maximum": 1000,
"minimum": 1,
"type": "integer"
},
"offset": {
"default": 0,
"description": "Pagination offset (default 0).",
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
},
"state": {
"description": "Two-letter state code to browse all PA projects for a state.",
"maxLength": 2,
"minLength": 2,
"type": "string"
}
},
"type": "object"
},
"name": "fema_get_public_assistance",
"outputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"projects",
"total_count",
"returned_count"
]
},
{
"required": [
"error"
]
}
],
"properties": {
"error": {
"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: `invalid_state`: The state parameter is not a valid 2-letter US state/territory code. `missing_filter`: Neither disaster_number nor state was provided. `not_found`: The disaster number is above 32767, the highest number OpenFEMA holds, so no declaration exists. `no_results`: No PA project records found for the given filters. Other values are possible when a failure originates below the handler.",
"examples": [
"invalid_state",
"missing_filter",
"not_found",
"no_results"
],
"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"
},
"notice": {
"description": "Paging guidance when offset is at or past the end of the matching projects — names the total and the last valid offset.",
"type": "string"
},
"projects": {
"description": "Public assistance funded project records.",
"items": {
"additionalProperties": false,
"description": "A single Public Assistance funded project record.",
"properties": {
"applicant_id": {
"description": "FEMA applicant identifier for the recipient organization. Absent when not recorded.",
"type": "string"
},
"application_title": {
"description": "Name of the applicant organization or project. Absent when not recorded.",
"type": "string"
},
"county": {
"description": "County where the project is located. Absent when not recorded.",
"type": "string"
},
"damage_category_code": {
"description": "FEMA damage category code (e.g., A=Debris Removal, B=Emergency Protective Measures, C=Roads and Bridges). Absent when unclassified.",
"type": "string"
},
"damage_category_description": {
"description": "Human-readable name for the damage category code. Absent when unclassified.",
"type": "string"
},
"disaster_number": {
"description": "FEMA disaster number this project belongs to.",
"type": "number"
},
"federal_share_obligated": {
"description": "Federal dollars obligated for this project in USD; 0 when nothing is obligated.",
"type": "number"
},
"first_obligation_date": {
"description": "ISO 8601 date the first federal obligation was recorded. Absent before obligation.",
"type": "string"
},
"project_amount": {
"description": "Total estimated project cost in USD. Absent when not yet determined.",
"type": "number"
},
"project_size": {
"description": "Project size classification: \"small\" (≤$1M) or \"large\" (>$1M). Absent when unclassified.",
"type": "string"
},
"project_status": {
"description": "Current project status (e.g., Obligated, Closed, In Progress). Absent when not set.",
"type": "string"
},
"pw_number": {
"description": "Project Worksheet number assigned by FEMA. Absent when not yet assigned.",
"type": "number"
},
"state": {
"description": "Two-letter state abbreviation. Absent when not recorded.",
"type": "string"
},
"total_obligated": {
"description": "Total obligated amount across all funding sources in USD; 0 when nothing is obligated.",
"type": "number"
}
},
"required": [
"disaster_number"
],
"type": "object"
},
"type": "array"
},
"returned_count": {
"description": "Number of projects in this response.",
"type": "number"
},
"totalCount": {
"description": "Total matching projects before pagination — exceeds returned_count when results were capped at the limit.",
"type": "number"
},
"total_count": {
"description": "Total matching projects before pagination.",
"type": "number"
}
},
"type": "object"
}
},
{
"description": "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.",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"dataset": {
"description": "OpenFEMA dataset entity name (case-sensitive, e.g., NfipPolicies, FemaWebDeclarationAreas, PublicAssistanceApplicants).",
"minLength": 1,
"type": "string"
},
"filter": {
"description": "OData $filter expression (e.g., \"state eq 'TX' and declarationDate ge '2024-01-01T00:00:00.000Z'\"). String values in single quotes.",
"type": "string"
},
"limit": {
"default": 100,
"description": "Maximum records to return (1–10000, default 100).",
"maximum": 10000,
"minimum": 1,
"type": "integer"
},
"offset": {
"default": 0,
"description": "Pagination offset (default 0).",
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
},
"orderby": {
"description": "OData $orderby expression (e.g., \"declarationDate desc\").",
"type": "string"
},
"select": {
"description": "Comma-separated field names to return (e.g., \"disasterNumber,state,declarationDate\").",
"type": "string"
}
},
"required": [
"dataset"
],
"type": "object"
},
"name": "fema_query_dataset",
"outputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"dataset",
"rows",
"total_count",
"returned_count"
]
},
{
"required": [
"error"
]
}
],
"properties": {
"dataset": {
"description": "The dataset that was queried.",
"type": "string"
},
"error": {
"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`: 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.",
"examples": [
"unknown_dataset",
"dataset_not_served",
"catalog_unavailable",
"invalid_filter",
"invalid_select",
"invalid_orderby",
"invalid_odata_syntax"
],
"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"
},
"notice": {
"description": "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.",
"type": "string"
},
"returned_count": {
"description": "Number of records in this response.",
"type": "number"
},
"rows": {
"description": "Records returned from the dataset. Field names depend on the queried dataset.",
"items": {
"additionalProperties": {},
"description": "A single record from the queried dataset. Field names and types vary by dataset.",
"properties": {},
"type": "object"
},
"type": "array"
},
"totalCount": {
"description": "Total matching records before pagination — exceeds returned_count when results were capped at the limit.",
"type": "number"
},
"total_count": {
"description": "Total matching records before pagination.",
"type": "number"
}
},
"type": "object"
}
},
{
"description": "Search federal disaster declarations by state, incident type, declaration type, date range, and county. Returns deduplicated declaration-level summaries — each disaster number appears once with a designatedAreaCount showing how many counties/municipalities were designated. The disaster number is the chain key for fema_get_disaster, fema_get_public_assistance, and fema_get_housing_assistance. Use declaration_type to filter: DR (major disaster, most common), EM (emergency), FM (fire management). Date filters apply to the declaration date. Use fema_get_disaster to retrieve all designated-area rows for a specific declaration. A search reads the most recent 10,000 designated-area rows; when more match, it returns the declarations dated after the day that window ends, sets truncated, and its notice names the date_to that continues with older declarations.",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"county": {
"description": "Filter by designated area / county name substring (e.g., Harris, Los Angeles). Case-insensitive.",
"type": "string"
},
"date_from": {
"anyOf": [
{
"const": "",
"type": "string"
},
{
"description": "Calendar date, YYYY-MM-DD.",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
"type": "string"
}
],
"description": "Start of the declaration date range as a calendar date in YYYY-MM-DD format (e.g., 2024-01-01). Inclusive."
},
"date_to": {
"anyOf": [
{
"const": "",
"type": "string"
},
{
"description": "Calendar date, YYYY-MM-DD.",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
"type": "string"
}
],
"description": "End of the declaration date range as a calendar date in YYYY-MM-DD format (e.g., 2024-12-31). Inclusive."
},
"declaration_type": {
"description": "Declaration type: DR (major disaster declaration), EM (emergency declaration), FM (fire management assistance declaration).",
"enum": [
"DR",
"EM",
"FM"
],
"type": "string"
},
"incident_type": {
"description": "Incident type filter (e.g., Flood, Hurricane, Tornado, Fire, Earthquake, Severe Storm). Case-insensitive substring match.",
"type": "string"
},
"limit": {
"default": 50,
"description": "Maximum number of unique disaster declarations to return (1–1000, default 50).",
"maximum": 1000,
"minimum": 1,
"type": "integer"
},
"offset": {
"default": 0,
"description": "Pagination offset in declarations (default 0). Use with limit to page through results.",
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
},
"state": {
"description": "Two-letter US state/territory code (e.g., TX, CA, FL, PR). Filters by state.",
"maxLength": 2,
"minLength": 2,
"type": "string"
}
},
"type": "object"
},
"name": "fema_search_disasters",
"outputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"declarations",
"total_declarations",
"total_area_rows",
"returned_count"
]
},
{
"required": [
"error"
]
}
],
"properties": {
"declarations": {
"description": "Disaster declarations matching the search, one entry per unique disaster number.",
"items": {
"additionalProperties": false,
"description": "Deduplicated summary for one disaster declaration.",
"properties": {
"declaration_date": {
"description": "ISO 8601 date the declaration was signed.",
"type": "string"
},
"declaration_type": {
"description": "Declaration type: DR (major disaster), EM (emergency), or FM (fire management).",
"type": "string"
},
"designated_area_count": {
"description": "Number of counties/municipalities designated — use fema_get_disaster for the full area list.",
"type": "number"
},
"disaster_number": {
"description": "Unique FEMA disaster number — pass to fema_get_disaster, fema_get_public_assistance, or fema_get_housing_assistance.",
"type": "number"
},
"hm_declared": {
"description": "True when Hazard Mitigation grants were declared.",
"type": "boolean"
},
"ia_declared": {
"description": "True when the Individuals and Households Program (IHP) was declared — indicates IA housing/personal grants are available.",
"type": "boolean"
},
"incident_begin_date": {
"description": "ISO 8601 incident start date. Absent when not recorded.",
"type": "string"
},
"incident_end_date": {
"description": "ISO 8601 incident end date. Absent for ongoing or unrecorded incidents.",
"type": "string"
},
"incident_type": {
"description": "Type of incident (e.g., Flood, Hurricane, Tornado, Severe Storm).",
"type": "string"
},
"pa_declared": {
"description": "True when Public Assistance (infrastructure recovery grants) was declared.",
"type": "boolean"
},
"state": {
"description": "Two-letter state/territory code.",
"type": "string"
},
"title": {
"description": "Official declaration title (e.g., \"SEVERE STORMS AND FLOODING\").",
"type": "string"
}
},
"required": [
"disaster_number",
"title",
"state",
"incident_type",
"declaration_type",
"declaration_date",
"ia_declared",
"pa_declared",
"hm_declared",
"designated_area_count"
],
"type": "object"
},
"type": "array"
},
"error": {
"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: `invalid_state`: The state parameter is not a valid 2-letter US state/territory code. `no_results`: Query returned zero disaster declarations. Other values are possible when a failure originates below the handler.",
"examples": [
"invalid_state",
"no_results"
],
"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"
},
"notice": {
"description": "Paging guidance: when offset is at or past the end of the matching declarations, the total and the last valid offset; when truncated is true, that the totals are lower bounds and the date_to (YYYY-MM-DD) to search next for older declarations.",
"type": "string"
},
"returned_count": {
"description": "Number of unique deduplicated declarations in this response.",
"type": "number"
},
"totalCount": {
"description": "Unique disaster declarations matching the query — the unit declaration-level pagination pages over. Exceeds returned_count when the matches span more than one page. A lower bound when truncated is true.",
"type": "number"
},
"total_area_rows": {
"description": "Total matching designated-area rows from the API (raw row count, not declaration count). DisasterDeclarationsSummaries returns one row per designated area per disaster, so this is always ≥ the number of unique declarations. When it exceeds 10,000, the search reads the most recent 10,000 rows and drops the declarations dated on the oldest day among them, so every returned declaration is complete; the notice names the date_to that continues with older declarations.",
"type": "number"
},
"total_declarations": {
"description": "Unique disaster declarations matching the query, before offset/limit paging — the bound for declaration-level pagination (limit/offset apply to declarations, not area rows). A lower bound when truncated is true: it counts only the declarations dated after the day the 10,000-row window ends.",
"type": "number"
},
"truncated": {
"description": "True when more than 10,000 designated-area rows match: the search covers only the declarations dated after the day its 10,000-row window ends. Each returned declaration is complete, the totals are lower bounds, and the notice names the date_to that continues with older declarations. Absent otherwise.",
"type": "boolean"
}
},
"type": "object"
}
},
{
"description": "Search National Flood Insurance Program (NFIP) claims data by state, county, ZIP code, and year range. Returns the matching claim count and claim records — amounts paid on building and contents, damage estimates, flood zones, cause and occupancy codes, and loss dates — newest loss first. state is required — the full NFIP dataset is 2.7 million rows; unfiltered access is prohibited. Page the inline claims with limit and offset; a page holds at most 100,000 characters of claims. When DataCanvas is enabled (CANVAS_PROVIDER_TYPE=duckdb) and the match exceeds that inline budget, a call at offset 0 stages the match (up to 50,000 claims) on a canvas: inspect the staged table with fema_dataframe_describe, then aggregate it with SQL via fema_dataframe_query.",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"canvas_id": {
"description": "Optional canvas ID from a prior call, to stage this match as another table on that canvas. Used only when the match is staged; omit it to stage on a fresh canvas. Pass the returned canvas_id to fema_dataframe_describe for the table columns, then to fema_dataframe_query for SQL.",
"pattern": "^[A-Za-z0-9_-]{10}$",
"type": "string"
},
"county_code": {
"description": "County code to narrow results within the state. Accepts the full 5-digit state+county FIPS (e.g., 48201 for Harris County TX) or the 3-digit county portion (e.g., 201) when state is provided — the server prepends the state FIPS automatically.",
"type": "string"
},
"limit": {
"default": 1000,
"description": "Maximum claims to return inline (1–10000, default 1000). A page also stops at 100,000 characters of claims (roughly 330 claims); when either bound leaves matching claims out, the notice names the offset to continue from. When DataCanvas is enabled and the match exceeds that character budget, a call at offset 0 stages the match on a canvas regardless of this value.",
"maximum": 10000,
"minimum": 1,
"type": "integer"
},
"offset": {
"default": 0,
"description": "Pagination offset into the matching claims, ordered newest date of loss first (default 0). Use with limit to page through a match. Only a call at offset 0 stages a match on a canvas; a later offset returns just its inline page. After a spill (spilled=true), read rows past the inline claims from the canvas table with fema_dataframe_query.",
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
},
"state": {
"description": "Two-letter US state code (required). NFIP dataset is 2.7M rows — state filter is mandatory.",
"maxLength": 2,
"minLength": 2,
"type": "string"
},
"year_from": {
"description": "Start year of loss, inclusive (e.g., 2020).",
"maximum": 2100,
"minimum": 1970,
"type": "integer"
},
"year_to": {
"description": "End year of loss, inclusive (e.g., 2023).",
"maximum": 2100,
"minimum": 1970,
"type": "integer"
},
"zip_code": {
"description": "ZIP code to narrow results to a specific area (5-digit, e.g., 77002).",
"pattern": "^\\d{5}$",
"type": "string"
}
},
"required": [
"state"
],
"type": "object"
},
"name": "fema_search_nfip",
"outputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"claims",
"total_count",
"returned_count",
"spilled"
]
},
{
"required": [
"error"
]
}
],
"properties": {
"canvas_id": {
"description": "Canvas ID for the staged match. Pass to fema_dataframe_describe and fema_dataframe_query. Present only when spilled=true.",
"type": "string"
},
"canvas_table": {
"description": "DuckDB table on the canvas holding the staged claims. List its columns with fema_dataframe_describe, then reference it in fema_dataframe_query FROM clauses. Present only when spilled=true.",
"type": "string"
},
"claims": {
"description": "Claims from offset onward, newest date of loss first, bounded by limit and 100,000 characters of claims. When spilled=true, canvas_table holds the staged match.",
"items": {
"additionalProperties": false,
"description": "A single NFIP flood insurance claim record.",
"properties": {
"amount_paid_building": {
"description": "NFIP claim payment for the building structure in USD; 0 when the claim paid nothing on the building. Absent when not recorded.",
"type": "number"
},
"amount_paid_contents": {
"description": "NFIP claim payment for contents (personal property) in USD; 0 when the claim paid nothing on contents. Absent when not recorded.",
"type": "number"
},
"building_damage_amount": {
"description": "Estimated total building damage in USD (may exceed paid amount). Absent when not assessed.",
"type": "number"
},
"cause_of_damage": {
"description": "OpenFEMA cause-of-damage code, as published: 0 other causes; 1 tidal water overflow; 2 stream, river, or lake overflow; 3 alluvial fan overflow; 4 accumulation of rainfall or snowmelt; 7 erosion-demolition; 8 erosion-removal; 9 earth movement, landslide, land subsidence, sinkholes, etc.; A closed basin lake; B expedited claim handling without site inspection; C expedited claim handling follow-up site inspection; D expedited claim handling by the Adjusting Process Pilot Program (remote adjustment). Other values pass through unchanged. Absent when not recorded.",
"type": "string"
},
"contents_damage_amount": {
"description": "Estimated total contents damage in USD (may exceed paid amount). Absent when not assessed.",
"type": "number"
},
"county_code": {
"description": "5-digit state+county FIPS code (e.g., 48201 for Harris County TX). Absent when not recorded.",
"type": "string"
},
"date_of_loss": {
"description": "ISO 8601 date the flood loss occurred. Absent when not recorded.",
"type": "string"
},
"occupancy_type": {
"description": "NFIP occupancy type code, as published. Legacy codes: 1 single-family residence; 2 residential building with 2 to 4 units; 3 residential building with more than 4 units; 4 non-residential building; 6 non-residential business. Risk Rating 2.0 codes: 11 single-family residential building (except a mobile home or a single unit within a multi-unit building); 12 residential non-condo building with 2 to 4 units, insuring all units; 13 residential non-condo building with 5 or more units, insuring all units; 14 residential mobile or manufactured home; 15 residential condo association building; 16 single residential unit within a multi-unit building; 17 non-residential mobile or manufactured home; 18 non-residential building; 19 non-residential unit within a multi-unit building. Other values pass through unchanged. Absent when not recorded.",
"type": "number"
},
"rated_flood_zone": {
"description": "FEMA flood zone designation at the property (e.g., AE, X, VE). Absent when not recorded.",
"type": "string"
},
"state": {
"description": "Two-letter state code. Absent when not in the record.",
"type": "string"
},
"year_of_loss": {
"description": "Calendar year the flood loss occurred. Absent when not recorded.",
"type": "number"
},
"zip_code": {
"description": "5-digit ZIP code of the insured property. Absent when not recorded.",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"error": {
"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: `invalid_state`: The state parameter is not a valid 2-letter US state/territory code. `no_results`: Query returned zero matching NFIP claims. Other values are possible when a failure originates below the handler.",
"examples": [
"invalid_state",
"no_results"
],
"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"
},
"notice": {
"description": "Paging and canvas guidance: the offset to continue from when claims were left out, the last valid offset when offset is past the end, or the canvas table and dataframe tools after a spill.",
"type": "string"
},
"returned_count": {
"description": "Number of claim records in claims.",
"type": "number"
},
"spilled": {
"description": "True when the match exceeded the inline budget and was staged on DataCanvas: call fema_dataframe_describe, then fema_dataframe_query, with canvas_id. False when nothing was staged.",
"type": "boolean"
},
"staged_count": {
"description": "Claims staged on canvas_table: the whole match, or its first 50,000 when truncated=true. Present only when spilled=true.",
"type": "number"
},
"total_count": {
"description": "Claims matching the filters, as counted by OpenFEMA — before offset, limit, and the canvas row cap.",
"type": "number"
},
"truncated": {
"description": "True when the 50,000-row canvas cap was reached: canvas_table holds staged_count of the total_count matching claims. Apply tighter filters (county_code, zip_code, year range) to stage the complete set.",
"type": "boolean"
}
},
"type": "object"
}
}
]
}Verify it yourself
curl -s https://api.teppi.xyz/v1/evidence/sha256:f7e365e2a347fcf04fd4a985c548337a32da221be29276dad2a0e074c1e2fada | sha256sum