fema-mcp-server
Query FEMA disaster declarations, public assistance grants, housing aid, and NFIP claims.
사용해야 할까요
품질 및 안전성
발견 사항 (2)
- HIGH
- MEDIUMfema_query_dataset에서
도구 정의와 프로토콜 준수에 대한 자동 분석을 기반으로 합니다.
컨텍스트 비용
이는 서버의 도구가 모델의 컨텍스트에 로드될 때마다 소비되는 대략적인 토큰 수입니다. 수치가 높을수록 다른 작업에 사용할 수 있는 주의가 줄어듭니다.
설치
원클릭 설치
`claude_desktop_config.json` 파일에 다음을 추가하세요:
{
"mcpServers": {
"fema-mcp-server": {
"command": "bun",
"args": [
"@cyanheads/fema-mcp-server"
]
}
}
}실행 가능한 패키지
0.3.1streamable-http원격 엔드포인트
https://fema.caseyjhand.com/mcpstreamable-http할 수 있는 일
도구 목록
도구 (8)
🟢fema_search_disasters(state, incident_type, declaration_type, date_from, date_to, ...)
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.
입력 스키마
{
"type": "object",
"properties": {
"state": {
"description": "Two-letter US state/territory code (e.g., TX, CA, FL, PR). Filters by state.",
"type": "string",
"minLength": 2,
"maxLength": 2
},
"incident_type": {
"description": "Incident type filter (e.g., Flood, Hurricane, Tornado, Fire, Earthquake, Severe Storm). Case-insensitive substring match.",
"type": "string"
},
"declaration_type": {
"description": "Declaration type: DR (major disaster declaration), EM (emergency declaration), FM (fire management assistance declaration).",
"type": "string",
"enum": [
"DR",
"EM",
"FM"
]
},
"date_from": {
"description": "Start of the declaration date range as a calendar date in YYYY-MM-DD format (e.g., 2024-01-01). Inclusive.",
"anyOf": [
{
"type": "string",
"const": ""
},
{
"type": "string",
"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])))$",
"description": "Calendar date, YYYY-MM-DD."
}
]
},
"date_to": {
"description": "End of the declaration date range as a calendar date in YYYY-MM-DD format (e.g., 2024-12-31). Inclusive.",
"anyOf": [
{
"type": "string",
"const": ""
},
{
"type": "string",
"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])))$",
"description": "Calendar date, YYYY-MM-DD."
}
]
},
"county": {
"description": "Filter by designated area / county name substring (e.g., Harris, Los Angeles). Case-insensitive.",
"type": "string"
},
"limit": {
"default": 50,
"description": "Maximum number of unique disaster declarations to return (1–1000, default 50).",
"type": "integer",
"minimum": 1,
"maximum": 1000
},
"offset": {
"default": 0,
"description": "Pagination offset in declarations (default 0). Use with limit to page through results.",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"declarations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"disaster_number": {
"type": "number",
"description": "Unique FEMA disaster number — pass to fema_get_disaster, fema_get_public_assistance, or fema_get_housing_assistance."
},
"title": {
"type": "string",
"description": "Official declaration title (e.g., \"SEVERE STORMS AND FLOODING\")."
},
"state": {
"type": "string",
"description": "Two-letter state/territory code."
},
"incident_type": {
"type": "string",
"description": "Type of incident (e.g., Flood, Hurricane, Tornado, Severe Storm)."
},
"declaration_type": {
"type": "string",
"description": "Declaration type: DR (major disaster), EM (emergency), or FM (fire management)."
},
"declaration_date": {
"type": "string",
"description": "ISO 8601 date the declaration was signed."
},
"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"
},
"ia_declared": {
"type": "boolean",
"description": "True when the Individuals and Households Program (IHP) was declared — indicates IA housing/personal grants are available."
},
"pa_declared": {
"type": "boolean",
"description": "True when Public Assistance (infrastructure recovery grants) was declared."
},
"hm_declared": {
"type": "boolean",
"description": "True when Hazard Mitigation grants were declared."
},
"designated_area_count": {
"type": "number",
"description": "Number of counties/municipalities designated — use fema_get_disaster for the full area list."
}
},
"required": [
"disaster_number",
"title",
"state",
"incident_type",
"declaration_type",
"declaration_date",
"ia_declared",
"pa_declared",
"hm_declared",
"designated_area_count"
],
"additionalProperties": false,
"description": "Deduplicated summary for one disaster declaration."
},
"description": "Disaster declarations matching the search, one entry per unique disaster number."
},
"total_declarations": {
"type": "number",
"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."
},
"total_area_rows": {
"type": "number",
"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."
},
"returned_count": {
"type": "number",
"description": "Number of unique deduplicated declarations in this response."
},
"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"
},
"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"
},
"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"
},
"error": {
"description": "Present when the call failed. Absent on success.",
"type": "object",
"properties": {
"code": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"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"
]
},
"recovery": {
"description": "Actionable next step for the caller.",
"type": "object",
"properties": {
"hint": {
"type": "string"
}
},
"required": [
"hint"
],
"additionalProperties": {}
},
"retryable": {
"description": "Whether retrying may succeed.",
"type": "boolean"
}
},
"additionalProperties": {}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}
},
"$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"
]
}
]
}🟢fema_get_disaster(disaster_number)
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.
입력 스키마
{
"type": "object",
"properties": {
"disaster_number": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"description": "FEMA disaster number (e.g., 4781). Obtain from fema_search_disasters."
}
},
"required": [
"disaster_number"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"disaster_number": {
"type": "number",
"description": "FEMA disaster number — use as the chain key for PA and housing assistance tools."
},
"title": {
"type": "string",
"description": "Official declaration title (e.g., \"SEVERE STORMS AND FLOODING\")."
},
"state": {
"type": "string",
"description": "Two-letter state/territory code."
},
"incident_type": {
"type": "string",
"description": "Type of incident (e.g., Flood, Hurricane, Severe Storm)."
},
"declaration_type": {
"type": "string",
"description": "Declaration type: DR (major disaster), EM (emergency), or FM (fire management)."
},
"declaration_date": {
"type": "string",
"description": "ISO 8601 date the declaration was signed."
},
"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"
},
"ia_declared": {
"type": "boolean",
"description": "True when the Individuals and Households Program (IHP) was declared — indicates IA housing/personal grants are available."
},
"pa_declared": {
"type": "boolean",
"description": "True when Public Assistance (infrastructure recovery grants) was declared."
},
"hm_declared": {
"type": "boolean",
"description": "True when Hazard Mitigation grants were declared."
},
"designated_areas": {
"type": "array",
"items": {
"type": "object",
"properties": {
"area": {
"type": "string",
"description": "Name of the designated county or municipality."
},
"fips_state_code": {
"description": "2-digit state FIPS code. Absent when not returned.",
"type": "string"
},
"fips_county_code": {
"description": "3-digit county FIPS code. Absent when not returned.",
"type": "string"
}
},
"required": [
"area"
],
"additionalProperties": false,
"description": "A single designated area entry."
},
"description": "All counties/municipalities designated for assistance under this declaration."
},
"designated_area_count": {
"type": "number",
"description": "Total number of designated areas in this declaration."
},
"error": {
"description": "Present when the call failed. Absent on success.",
"type": "object",
"properties": {
"code": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"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"
]
},
"recovery": {
"description": "Actionable next step for the caller.",
"type": "object",
"properties": {
"hint": {
"type": "string"
}
},
"required": [
"hint"
],
"additionalProperties": {}
},
"retryable": {
"description": "Whether retrying may succeed.",
"type": "boolean"
}
},
"additionalProperties": {}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}
},
"$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"
]
}
]
}🟢fema_get_public_assistance(disaster_number, state, county, limit, offset)
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).
입력 스키마
{
"type": "object",
"properties": {
"disaster_number": {
"description": "FEMA disaster number to scope results to a single declaration. Numbers above 32767 match no declaration.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"state": {
"description": "Two-letter state code to browse all PA projects for a state.",
"type": "string",
"minLength": 2,
"maxLength": 2
},
"county": {
"description": "Filter by county name substring.",
"type": "string"
},
"limit": {
"default": 100,
"description": "Maximum number of projects to return (1–1000, default 100).",
"type": "integer",
"minimum": 1,
"maximum": 1000
},
"offset": {
"default": 0,
"description": "Pagination offset (default 0).",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"projects": {
"type": "array",
"items": {
"type": "object",
"properties": {
"disaster_number": {
"type": "number",
"description": "FEMA disaster number this project belongs to."
},
"pw_number": {
"description": "Project Worksheet number assigned by FEMA. Absent when not yet assigned.",
"type": "number"
},
"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"
},
"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"
},
"project_amount": {
"description": "Total estimated project cost in USD. Absent when not yet determined.",
"type": "number"
},
"federal_share_obligated": {
"description": "Federal dollars obligated for this project in USD; 0 when nothing is obligated.",
"type": "number"
},
"total_obligated": {
"description": "Total obligated amount across all funding sources in USD; 0 when nothing is obligated.",
"type": "number"
},
"county": {
"description": "County where the project is located. Absent when not recorded.",
"type": "string"
},
"state": {
"description": "Two-letter state abbreviation. Absent when not recorded.",
"type": "string"
},
"project_status": {
"description": "Current project status (e.g., Obligated, Closed, In Progress). Absent when not set.",
"type": "string"
},
"project_size": {
"description": "Project size classification: \"small\" (≤$1M) or \"large\" (>$1M). Absent when unclassified.",
"type": "string"
},
"first_obligation_date": {
"description": "ISO 8601 date the first federal obligation was recorded. Absent before obligation.",
"type": "string"
}
},
"required": [
"disaster_number"
],
"additionalProperties": false,
"description": "A single Public Assistance funded project record."
},
"description": "Public assistance funded project records."
},
"total_count": {
"type": "number",
"description": "Total matching projects before pagination."
},
"returned_count": {
"type": "number",
"description": "Number of projects in this response."
},
"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"
},
"totalCount": {
"description": "Total matching projects before pagination — exceeds returned_count when results were capped at the limit.",
"type": "number"
},
"error": {
"description": "Present when the call failed. Absent on success.",
"type": "object",
"properties": {
"code": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"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"
]
},
"recovery": {
"description": "Actionable next step for the caller.",
"type": "object",
"properties": {
"hint": {
"type": "string"
}
},
"required": [
"hint"
],
"additionalProperties": {}
},
"retryable": {
"description": "Whether retrying may succeed.",
"type": "boolean"
}
},
"additionalProperties": {}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"projects",
"total_count",
"returned_count"
]
},
{
"required": [
"error"
]
}
]
}🟢fema_get_housing_assistance(disaster_number, state, type, limit, offset)
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.
입력 스키마
{
"type": "object",
"properties": {
"disaster_number": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"description": "FEMA disaster number. Obtain from fema_search_disasters. Numbers above 32767 match no declaration."
},
"state": {
"description": "Two-letter state code to narrow results when a disaster spans multiple states.",
"type": "string",
"minLength": 2,
"maxLength": 2
},
"type": {
"default": "both",
"description": "Which housing assistance dataset to query: owners, renters, or both (default).",
"type": "string",
"enum": [
"owners",
"renters",
"both"
]
},
"limit": {
"default": 100,
"description": "Maximum records per dataset to return (default 100).",
"type": "integer",
"minimum": 1,
"maximum": 1000
},
"offset": {
"default": 0,
"description": "Pagination offset (default 0).",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"disaster_number"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"owners": {
"type": "array",
"items": {
"type": "object",
"properties": {
"disaster_number": {
"type": "number",
"description": "FEMA disaster number this record belongs to."
},
"state": {
"description": "Two-letter state code. Absent when not recorded.",
"type": "string"
},
"county": {
"description": "County name. Absent when not recorded.",
"type": "string"
},
"city": {
"description": "City name. Absent when not recorded.",
"type": "string"
},
"zip_code": {
"description": "5-digit ZIP code; 00000 when OpenFEMA files the records under no ZIP code. Absent when not recorded.",
"type": "string"
},
"valid_registrations": {
"description": "Number of valid IA registrations from homeowners in this area. Absent when not reported.",
"type": "number"
},
"approved_for_fema_assistance": {
"description": "Number of homeowner registrations approved for any FEMA assistance; 0 when none were. Absent when not reported.",
"type": "number"
},
"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"
},
"repair_replace_amount": {
"description": "Home repair and replacement 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"
},
"other_needs_amount": {
"description": "Other needs assistance (personal property, transportation, etc.) in USD; 0 when none was approved. Absent when not reported.",
"type": "number"
}
},
"required": [
"disaster_number"
],
"additionalProperties": false,
"description": "Homeowner housing assistance aggregated by county and ZIP for one disaster."
},
"description": "Homeowner (HousingAssistanceOwners) records. Empty when type is \"renters\" or no owner data exists."
},
"renters": {
"type": "array",
"items": {
"type": "object",
"properties": {
"disaster_number": {
"type": "number",
"description": "FEMA disaster number this record belongs to."
},
"state": {
"description": "Two-letter state code. Absent when not recorded.",
"type": "string"
},
"county": {
"description": "County name. Absent when not recorded.",
"type": "string"
},
"city": {
"description": "City name. Absent when not recorded.",
"type": "string"
},
"zip_code": {
"description": "5-digit ZIP code; 00000 when OpenFEMA files the records under no ZIP code. Absent when not recorded.",
"type": "string"
},
"valid_registrations": {
"description": "Number of valid IA registrations from renters in this area. Absent when not reported.",
"type": "number"
},
"approved_for_fema_assistance": {
"description": "Number of renter registrations approved for any FEMA assistance; 0 when none were. Absent when not reported.",
"type": "number"
},
"total_approved_ihp_amount": {
"description": "Total IHP assistance approved for renters in USD; 0 when none was. Absent when not reported.",
"type": "number"
},
"rental_amount": {
"description": "Rental assistance granted in USD; 0 when none was. Absent when not reported.",
"type": "number"
},
"other_needs_amount": {
"description": "Other needs assistance in USD; 0 when none was approved. Absent when not reported.",
"type": "number"
}
},
"required": [
"disaster_number"
],
"additionalProperties": false,
"description": "Renter housing assistance aggregated by county and ZIP for one disaster."
},
"description": "Renter (HousingAssistanceRenters) records. Empty when type is \"owners\" or no renter data exists."
},
"owners_count": {
"type": "number",
"description": "Total owner records available before the per-dataset limit."
},
"renters_count": {
"type": "number",
"description": "Total renter records available before the per-dataset limit."
},
"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"
},
"totalCount": {
"description": "Total owner + renter records available before the per-dataset limit — exceeds the returned count when either dataset was capped.",
"type": "number"
},
"error": {
"description": "Present when the call failed. Absent on success.",
"type": "object",
"properties": {
"code": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"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"
]
},
"recovery": {
"description": "Actionable next step for the caller.",
"type": "object",
"properties": {
"hint": {
"type": "string"
}
},
"required": [
"hint"
],
"additionalProperties": {}
},
"retryable": {
"description": "Whether retrying may succeed.",
"type": "boolean"
}
},
"additionalProperties": {}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"owners",
"renters",
"owners_count",
"renters_count"
]
},
{
"required": [
"error"
]
}
]
}🟢fema_search_nfip(state, county_code, zip_code, year_from, year_to, ...)
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.
입력 스키마
{
"type": "object",
"properties": {
"state": {
"type": "string",
"minLength": 2,
"maxLength": 2,
"description": "Two-letter US state code (required). NFIP dataset is 2.7M rows — state filter is mandatory."
},
"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"
},
"zip_code": {
"description": "ZIP code to narrow results to a specific area (5-digit, e.g., 77002).",
"type": "string",
"pattern": "^\\d{5}$"
},
"year_from": {
"description": "Start year of loss, inclusive (e.g., 2020).",
"type": "integer",
"minimum": 1970,
"maximum": 2100
},
"year_to": {
"description": "End year of loss, inclusive (e.g., 2023).",
"type": "integer",
"minimum": 1970,
"maximum": 2100
},
"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.",
"type": "integer",
"minimum": 1,
"maximum": 10000
},
"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.",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"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.",
"type": "string",
"pattern": "^[A-Za-z0-9_-]{10}$"
}
},
"required": [
"state"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"claims": {
"type": "array",
"items": {
"type": "object",
"properties": {
"state": {
"description": "Two-letter state code. Absent when not in the record.",
"type": "string"
},
"county_code": {
"description": "5-digit state+county FIPS code (e.g., 48201 for Harris County TX). Absent when not recorded.",
"type": "string"
},
"zip_code": {
"description": "5-digit ZIP code of the insured property. Absent when not recorded.",
"type": "string"
},
"date_of_loss": {
"description": "ISO 8601 date the flood loss occurred. Absent when not recorded.",
"type": "string"
},
"year_of_loss": {
"description": "Calendar year the flood loss occurred. Absent when not recorded.",
"type": "number"
},
"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"
},
"contents_damage_amount": {
"description": "Estimated total contents damage in USD (may exceed paid amount). Absent when not assessed.",
"type": "number"
},
"rated_flood_zone": {
"description": "FEMA flood zone designation at the property (e.g., AE, X, VE). Absent when not recorded.",
"type": "string"
},
"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"
},
"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"
}
},
"additionalProperties": false,
"description": "A single NFIP flood insurance claim record."
},
"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."
},
"total_count": {
"type": "number",
"description": "Claims matching the filters, as counted by OpenFEMA — before offset, limit, and the canvas row cap."
},
"returned_count": {
"type": "number",
"description": "Number of claim records in claims."
},
"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"
},
"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"
},
"spilled": {
"type": "boolean",
"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."
},
"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"
},
"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"
},
"error": {
"description": "Present when the call failed. Absent on success.",
"type": "object",
"properties": {
"code": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"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"
]
},
"recovery": {
"description": "Actionable next step for the caller.",
"type": "object",
"properties": {
"hint": {
"type": "string"
}
},
"required": [
"hint"
],
"additionalProperties": {}
},
"retryable": {
"description": "Whether retrying may succeed.",
"type": "boolean"
}
},
"additionalProperties": {}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"claims",
"total_count",
"returned_count",
"spilled"
]
},
{
"required": [
"error"
]
}
]
}🟢fema_dataframe_query(canvas_id, query)
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.
입력 스키마
{
"type": "object",
"properties": {
"canvas_id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{10}$",
"description": "Canvas ID from the fema_search_nfip response (the canvas_id field)."
},
"query": {
"type": "string",
"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\""
}
},
"required": [
"canvas_id",
"query"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"rows": {
"type": "array",
"items": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {},
"description": "A single result row — keys are column names from the SELECT, values are the computed data."
},
"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)."
},
"row_count": {
"type": "number",
"description": "Number of rows in this response (may be capped at the canvas row limit)."
},
"canvas_id": {
"type": "string",
"description": "Canvas ID that was queried — reuse for follow-up queries."
},
"truncated": {
"description": "True when the result was capped at the canvas row limit — more rows match than were returned.",
"type": "boolean"
},
"shown": {
"description": "Number of rows returned in this (capped) response.",
"type": "number"
},
"cap": {
"description": "The canvas row limit that was applied when the result was capped.",
"type": "number"
},
"notice": {
"description": "Continuation guidance when capped — how to page the remainder with LIMIT/OFFSET.",
"type": "string"
},
"error": {
"description": "Present when the call failed. Absent on success.",
"type": "object",
"properties": {
"code": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"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"
]
},
"recovery": {
"description": "Actionable next step for the caller.",
"type": "object",
"properties": {
"hint": {
"type": "string"
}
},
"required": [
"hint"
],
"additionalProperties": {}
},
"retryable": {
"description": "Whether retrying may succeed.",
"type": "boolean"
}
},
"additionalProperties": {}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"rows",
"row_count",
"canvas_id"
]
},
{
"required": [
"error"
]
}
]
}🟢fema_dataframe_describe(canvas_id)
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.
입력 스키마
{
"type": "object",
"properties": {
"canvas_id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{10}$",
"description": "Canvas ID from the fema_search_nfip response."
}
},
"required": [
"canvas_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"tables": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Table or view name — use this exact string in SQL FROM clauses."
},
"kind": {
"type": "string",
"description": "Object type: \"table\" for a registered data table, \"view\" for a derived view."
},
"row_count": {
"type": "number",
"description": "Total rows in this table — the full staged result set, not the inline preview count."
},
"columns": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Column name — use in SELECT, WHERE, GROUP BY, and ORDER BY clauses."
},
"type": {
"type": "string",
"description": "DuckDB SQL data type (e.g., VARCHAR, DOUBLE, INTEGER, BOOLEAN)."
},
"nullable": {
"description": "True when the column can contain NULL values. Absent when nullability is unknown.",
"type": "boolean"
}
},
"required": [
"name",
"type"
],
"additionalProperties": false,
"description": "A single column in the table."
},
"description": "All columns in this table, in schema order."
}
},
"required": [
"name",
"kind",
"row_count",
"columns"
],
"additionalProperties": false,
"description": "A single registered table or view on the canvas."
},
"description": "All tables and views available on this canvas."
},
"canvas_id": {
"type": "string",
"description": "Canvas ID that was described — pass to fema_dataframe_query."
},
"error": {
"description": "Present when the call failed. Absent on success.",
"type": "object",
"properties": {
"code": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"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"
]
},
"recovery": {
"description": "Actionable next step for the caller.",
"type": "object",
"properties": {
"hint": {
"type": "string"
}
},
"required": [
"hint"
],
"additionalProperties": {}
},
"retryable": {
"description": "Whether retrying may succeed.",
"type": "boolean"
}
},
"additionalProperties": {}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"tables",
"canvas_id"
]
},
{
"required": [
"error"
]
}
]
}🟢fema_query_dataset(dataset, filter, select, orderby, limit, ...)
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.
입력 스키마
{
"type": "object",
"properties": {
"dataset": {
"type": "string",
"minLength": 1,
"description": "OpenFEMA dataset entity name (case-sensitive, e.g., NfipPolicies, FemaWebDeclarationAreas, PublicAssistanceApplicants)."
},
"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"
},
"select": {
"description": "Comma-separated field names to return (e.g., \"disasterNumber,state,declarationDate\").",
"type": "string"
},
"orderby": {
"description": "OData $orderby expression (e.g., \"declarationDate desc\").",
"type": "string"
},
"limit": {
"default": 100,
"description": "Maximum records to return (1–10000, default 100).",
"type": "integer",
"minimum": 1,
"maximum": 10000
},
"offset": {
"default": 0,
"description": "Pagination offset (default 0).",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"dataset"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"dataset": {
"type": "string",
"description": "The dataset that was queried."
},
"rows": {
"type": "array",
"items": {
"type": "object",
"properties": {},
"additionalProperties": {},
"description": "A single record from the queried dataset. Field names and types vary by dataset."
},
"description": "Records returned from the dataset. Field names depend on the queried dataset."
},
"total_count": {
"type": "number",
"description": "Total matching records before pagination."
},
"returned_count": {
"type": "number",
"description": "Number of records in this response."
},
"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"
},
"totalCount": {
"description": "Total matching records before pagination — exceeds returned_count when results were capped at the limit.",
"type": "number"
},
"error": {
"description": "Present when the call failed. Absent on success.",
"type": "object",
"properties": {
"code": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"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"
]
},
"recovery": {
"description": "Actionable next step for the caller.",
"type": "object",
"properties": {
"hint": {
"type": "string"
}
},
"required": [
"hint"
],
"additionalProperties": {}
},
"retryable": {
"description": "Whether retrying may succeed.",
"type": "boolean"
}
},
"additionalProperties": {}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"dataset",
"rows",
"total_count",
"returned_count"
]
},
{
"required": [
"error"
]
}
]
}커뮤니티
증거