Skip to main content
Glama

get_tide_predictions

Retrieve tide prediction data for specific stations using station ID, date range, units, and output format. Access accurate water level information via the LocalTides MCP Server.

Instructions

Get tide prediction data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
begin_dateNoStart date (YYYYMMDD or MM/DD/YYYY)
dateNoDate to retrieve data for ("today", "latest", "recent", or specific date)
datumNoDatum to use (MLLW, MSL, etc.)
end_dateNoEnd date (YYYYMMDD or MM/DD/YYYY)
formatNoOutput format (json, xml, csv)
intervalNoInterval (hilo, hl, h, or a number for minutes)
rangeNoNumber of hours to retrieve data for
stationYesStation ID
time_zoneNoTime zone (gmt, lst, lst_ldt)
unitsNoUnits to use ("english" or "metric")

Implementation Reference

  • Core handler function that fetches tide predictions from NOAA API by setting product to 'predictions' and calling fetchDataApi.
    async getTidePredictions(params: Record<string, any>): Promise<any> { return this.fetchDataApi({ ...params, product: 'predictions' }); }
  • Registration of the 'get_tide_predictions' tool in McpServer, including name, description, input schema, and handler delegating to noaaService.
    const getTidePredictions: MCPTool = { name: "get_tide_predictions", description: "Get tide prediction data", inputSchema: GetTidePredictionsSchema, handler: async (params) => { return this.noaaService.getTidePredictions(params); } };
  • Zod input schema for validating parameters to the get_tide_predictions tool.
    export const GetTidePredictionsSchema = z.object({ station: StationSchema, begin_date: BeginDateSchema, end_date: EndDateSchema, date: DateSchema, range: RangeSchema, datum: DatumSchema, units: UnitsSchema, time_zone: TimeZoneSchema, interval: IntervalSchema, format: FormatSchema, }).refine( data => (data.date || (data.begin_date && data.end_date) || (data.begin_date && data.range) || (data.end_date && data.range) || data.range), { message: "You must provide either 'date', 'begin_date' and 'end_date', 'begin_date' and 'range', 'end_date' and 'range', or just 'range'" } );
  • Alternative registration of 'get_tide_predictions' tool using FastMCP server.addTool with inline schema and execute handler.
    server.addTool({ name: 'get_tide_predictions', description: 'Get tide prediction data', parameters: z.object({ station: StationSchema, begin_date: BeginDateSchema, end_date: EndDateSchema, date: DateSchema, range: RangeSchema, datum: DatumSchema, units: UnitsSchema, time_zone: TimeZoneSchema, interval: IntervalSchema, format: FormatSchema, }).refine(refineDateParams, { message: dateRefinementMessage }), execute: async (params) => { try { const result = await noaaService.getTidePredictions(params); return JSON.stringify(result); } catch (error) { if (error instanceof Error) { throw new Error(`Failed to get tide predictions: ${error.message}`); } throw new Error('Failed to get tide predictions'); } } });

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