Skip to main content
Glama
RyanCardin15

noaa-tidesandcurrents-mcp

get_extreme_water_levels

Retrieve extreme water levels and exceedance probabilities for a specific station using station ID, with output in JSON, XML, or CSV formats. Supports English or metric units.

Instructions

Get extreme water levels and exceedance probabilities for a station

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNoOutput format (json, xml, csv)
stationYesStation ID
unitsNoUnits to use ("english" or "metric")

Implementation Reference

  • The MCP tool handler (execute function) that calls the DpapiService method and returns the JSON-stringified result, with error handling.
    execute: async (params) => {
      try {
        const result = await dpapiService.getExtremeWaterLevels(params);
        return JSON.stringify(result);
      } catch (error) {
        if (error instanceof Error) {
          throw new Error(`Failed to get extreme water levels: ${error.message}`);
        }
        throw new Error('Failed to get extreme water levels');
      }
    }
  • Zod schema defining the input parameters for the get_extreme_water_levels tool (station, units, format).
    export const ExtremeWaterLevelsSchema = z.object({
      station: StationSchema,
      units: UnitsSchema,
      format: FormatSchema
    }).describe('Get extreme water levels for a station');
  • Registration of the get_extreme_water_levels tool on the FastMCP server, including name, description, input schema, and handler.
    server.addTool({
      name: 'get_extreme_water_levels',
      description: 'Get extreme water levels and exceedance probabilities for a station',
      parameters: ExtremeWaterLevelsSchema,
      execute: async (params) => {
        try {
          const result = await dpapiService.getExtremeWaterLevels(params);
          return JSON.stringify(result);
        } catch (error) {
          if (error instanceof Error) {
            throw new Error(`Failed to get extreme water levels: ${error.message}`);
          }
          throw new Error('Failed to get extreme water levels');
        }
      }
    });
  • Supporting service method in DpapiService that constructs and fetches from the NOAA DPAPI '/ewl' endpoint for extreme water levels data.
    async getExtremeWaterLevels(params: Record<string, any>): Promise<any> {
      const { station, units = 'english', format = 'json', ...rest } = params;
      
      return this.fetchDpapi('/ewl', {
        station,
        units,
        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'

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