Skip to main content
Glama

get_current_predictions

Retrieve current and tide predictions for specific stations using station ID, date range, and customizable parameters like time zone, units, and output format on LocalTides MCP Server.

Instructions

Get current predictions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
begin_dateNoStart date (YYYYMMDD or MM/DD/YYYY)
binNoBin number
dateNoDate to retrieve data for ("today", "latest", "recent", or specific date)
end_dateNoEnd date (YYYYMMDD or MM/DD/YYYY)
formatNoOutput format (json, xml, csv)
intervalNoInterval (MAX_SLACK 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")
vel_typeNoVelocity type (speed_dir or default)

Implementation Reference

  • The core handler function that executes the tool logic by fetching current predictions data from the NOAA API using the appropriate product parameter.
    async getCurrentPredictions(params: Record<string, any>): Promise<any> { return this.fetchDataApi({ ...params, product: 'currents_predictions' }); }
  • Zod schema defining the input parameters and validation for the get_current_predictions tool.
    export const GetCurrentPredictionsSchema = z.object({ station: StationSchema, date: DateSchema, begin_date: BeginDateSchema, end_date: EndDateSchema, range: RangeSchema, bin: BinSchema, interval: z.string().optional().describe('Interval (MAX_SLACK or a number for minutes)'), vel_type: z.enum(['speed_dir', 'default']).optional().describe('Velocity type (speed_dir or default)'), units: UnitsSchema, time_zone: TimeZoneSchema, 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'" } );
  • Registration of the get_current_predictions tool in the custom McpServer class, specifying name, description, input schema, and handler that delegates to NoaaService.
    const getCurrentPredictions: MCPTool = { name: "get_current_predictions", description: "Get current predictions", inputSchema: GetCurrentPredictionsSchema, handler: async (params) => { return this.noaaService.getCurrentPredictions(params); } };
  • Alternative registration of the get_current_predictions tool using FastMCP server.addTool, with inline schema and execute handler calling NoaaService.
    server.addTool({ name: 'get_current_predictions', description: 'Get current predictions', parameters: z.object({ station: StationSchema, date: DateSchema, begin_date: BeginDateSchema, end_date: EndDateSchema, range: RangeSchema, bin: BinSchema, interval: z.string().optional().describe('Interval (MAX_SLACK or a number for minutes)'), vel_type: z.enum(['speed_dir', 'default']).optional().describe('Velocity type (speed_dir or default)'), units: UnitsSchema, time_zone: TimeZoneSchema, format: FormatSchema, }).refine(refineDateParams, { message: dateRefinementMessage }), execute: async (params) => { try { const result = await noaaService.getCurrentPredictions(params); return JSON.stringify(result); } catch (error) { if (error instanceof Error) { throw new Error(`Failed to get current predictions: ${error.message}`); } throw new Error('Failed to get current 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