get_high_tide_flooding_monthly
Retrieve monthly high tide flooding counts for a specific station using NOAA Tides and Currents data. Specify station ID, flood threshold, and date range to analyze flooding trends in JSON, XML, or CSV formats.
Instructions
Get high tide flooding monthly count data for a station
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| begin_date | No | Start date (YYYYMMDD format) | |
| datum | No | Datum reference for DPAPI | |
| end_date | No | End date (YYYYMMDD format) | |
| format | No | Output format (json, xml, csv) | |
| station | Yes | Station ID | |
| threshold | No | Flood threshold level | |
| year | No | Year for analysis (YYYY format) |
Implementation Reference
- src/services/dpapi-service.ts:102-110 (handler)Core handler function in DpapiService that executes the logic for retrieving high tide flooding monthly data by making an API call to the NOAA DPAPI '/htf/monthly' endpoint.async getHighTideFloodingMonthly(params: Record<string, any>): Promise<any> { const { station, format = 'json', ...rest } = params; return this.fetchDpapi('/htf/monthly', { station, format, ...rest }); }
- src/schemas/dpapi.ts:39-48 (schema)Zod schema defining the input parameters and validation for the get_high_tide_flooding_monthly tool.// High Tide Flooding Monthly schema export const HighTideFloodingMonthlySchema = z.object({ station: StationSchema, format: FormatSchema, datum: DpapiDatumSchema, threshold: ThresholdSchema, begin_date: z.string().optional().describe('Start date (YYYYMMDD format)'), end_date: z.string().optional().describe('End date (YYYYMMDD format)'), year: YearSchema }).describe('Get high tide flooding monthly count data');
- src/tools/derived-product-tools.ts:74-89 (registration)Tool registration in derived product tools module, specifying name, description, input schema, and execute handler that wraps the DpapiService call and handles errors.server.addTool({ name: 'get_high_tide_flooding_monthly', description: 'Get high tide flooding monthly count data for a station', parameters: HighTideFloodingMonthlySchema, execute: async (params) => { try { const result = await dpapiService.getHighTideFloodingMonthly(params); return JSON.stringify(result); } catch (error) { if (error instanceof Error) { throw new Error(`Failed to get high tide flooding monthly data: ${error.message}`); } throw new Error('Failed to get high tide flooding monthly data'); } } });