get_top_ten_water_levels
Retrieve the top ten highest or lowest water levels for a specific station using JSON, XML, or CSV formats, with options for datum reference and unit preferences. Facilitates analysis of water level data on the LocalTides MCP Server.
Instructions
Get top ten highest or lowest water levels for a station
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| analysis_type | No | Analysis type (highest or lowest) | |
| datum | No | Datum reference for DPAPI | |
| format | No | Output format (json, xml, csv) | |
| station | Yes | Station ID | |
| units | No | Units to use ("english" or "metric") |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"description": "Get top ten water levels for a station",
"properties": {
"analysis_type": {
"description": "Analysis type (highest or lowest)",
"enum": [
"highest",
"lowest"
],
"type": "string"
},
"datum": {
"description": "Datum reference for DPAPI",
"enum": [
"STND",
"MLLW",
"MHHW",
"GT",
"MSL",
"MLW",
"MHW"
],
"type": "string"
},
"format": {
"description": "Output format (json, xml, csv)",
"enum": [
"json",
"xml",
"csv"
],
"type": "string"
},
"station": {
"description": "Station ID",
"minLength": 1,
"type": "string"
},
"units": {
"description": "Units to use (\"english\" or \"metric\")",
"enum": [
"english",
"metric"
],
"type": "string"
}
},
"required": [
"station"
],
"type": "object"
}
Implementation Reference
- src/services/dpapi-service.ts:178-186 (handler)Implementation of getTopTenWaterLevels that fetches data from NOAA DPAPI /topten endpoint.async getTopTenWaterLevels(params: Record<string, any>): Promise<any> { const { station, format = 'json', ...rest } = params; return this.fetchDpapi('/topten', { station, format, ...rest }); }
- src/schemas/dpapi.ts:93-99 (schema)Zod input schema defining parameters for the get_top_ten_water_levels tool, including station, format, datum, units, and analysis_type.export const TopTenWaterLevelsSchema = z.object({ station: StationSchema, format: FormatSchema, datum: DpapiDatumSchema, units: UnitsSchema, analysis_type: z.enum(['highest', 'lowest']).optional().describe('Analysis type (highest or lowest)') }).describe('Get top ten water levels for a station');
- src/tools/derived-product-tools.ts:164-179 (registration)Tool registration in FastMCP server, specifying name, description, input schema, and execute handler that calls the service method.server.addTool({ name: 'get_top_ten_water_levels', description: 'Get top ten highest or lowest water levels for a station', parameters: TopTenWaterLevelsSchema, execute: async (params) => { try { const result = await dpapiService.getTopTenWaterLevels(params); return JSON.stringify(result); } catch (error) { if (error instanceof Error) { throw new Error(`Failed to get top ten water levels: ${error.message}`); } throw new Error('Failed to get top ten water levels'); } } });