Skip to main content
Glama
RyanCardin15

LocalTides MCP Server

get_high_tide_flooding_annual

Retrieve annual high tide flooding counts for a specific station based on station ID, flood threshold, date range, and preferred output format (JSON, XML, CSV).

Instructions

Get high tide flooding annual count data for a station

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
begin_dateNoStart date (YYYYMMDD format)
datumNoDatum reference for DPAPI
end_dateNoEnd date (YYYYMMDD format)
formatNoOutput format (json, xml, csv)
stationYesStation ID
thresholdNoFlood threshold level
year_rangeNoYear range (YYYY-YYYY format)

Implementation Reference

  • The execute handler for the get_high_tide_flooding_annual tool, which delegates to the dpapiService.getHighTideFloodingAnnual method and returns the JSON-stringified result, with error handling.
    execute: async (params) => {
      try {
        const result = await dpapiService.getHighTideFloodingAnnual(params);
        return JSON.stringify(result);
      } catch (error) {
        if (error instanceof Error) {
          throw new Error(`Failed to get high tide flooding annual data: ${error.message}`);
        }
        throw new Error('Failed to get high tide flooding annual data');
      }
  • Zod schema defining the input parameters and validation for the get_high_tide_flooding_annual tool.
    export const HighTideFloodingAnnualSchema = 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_range: YearRangeSchema
    }).describe('Get high tide flooding annual count data');
  • Registers the get_high_tide_flooding_annual tool with the FastMCP server, including name, description, schema, and handler.
    server.addTool({
      name: 'get_high_tide_flooding_annual',
      description: 'Get high tide flooding annual count data for a station',
      parameters: HighTideFloodingAnnualSchema,
      execute: async (params) => {
        try {
          const result = await dpapiService.getHighTideFloodingAnnual(params);
          return JSON.stringify(result);
        } catch (error) {
          if (error instanceof Error) {
            throw new Error(`Failed to get high tide flooding annual data: ${error.message}`);
          }
          throw new Error('Failed to get high tide flooding annual data');
        }
      }
    });
  • DpapiService method that makes the API request to NOAA's /htf/annual endpoint for high tide flooding annual data.
    async getHighTideFloodingAnnual(params: Record<string, any>): Promise<any> {
      const { station, format = 'json', ...rest } = params;
      
      return this.fetchDpapi('/htf/annual', {
        station,
        format,
        ...rest
      });
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RyanCardin15/NOAA-TidesAndCurrents-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server