get_sea_level_trends
Retrieve sea level trends and error margins for specific stations using station ID and output in JSON, XML, or CSV formats. Ideal for analyzing NOAA Tides and Currents data.
Instructions
Get sea level trends and error margins for a station
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| affil | No | Station affiliation (Global or US) | |
| format | No | Output format (json, xml, csv) | |
| station | Yes | Station ID |
Implementation Reference
- src/services/dpapi-service.ts:55-64 (handler)Core handler function that fetches sea level trends data from the NOAA DPAPI by building parameters and calling the generic fetchDpapi method.async getSeaLevelTrends(params: Record<string, any>): Promise<any> { const { station, affil = 'Global', format = 'json', ...rest } = params; return this.fetchDpapi('/sltrends', { station, affil, format, ...rest }); }
- src/schemas/dpapi.ts:15-19 (schema)Zod schema for input validation of the get_sea_level_trends tool parameters: station, affiliation (affil), and format.export const SeaLevelTrendsSchema = z.object({ station: StationSchema, affil: AffiliationSchema, format: FormatSchema }).describe('Get sea level trends for a station');
- src/tools/derived-product-tools.ts:20-35 (registration)Registers the 'get_sea_level_trends' tool with the FastMCP server, specifying name, description, input schema, and an execute handler that calls the DpapiService and returns JSON stringified result.server.addTool({ name: 'get_sea_level_trends', description: 'Get sea level trends and error margins for a station', parameters: SeaLevelTrendsSchema, execute: async (params) => { try { const result = await dpapiService.getSeaLevelTrends(params); return JSON.stringify(result); } catch (error) { if (error instanceof Error) { throw new Error(`Failed to get sea level trends: ${error.message}`); } throw new Error('Failed to get sea level trends'); } } });