get_station_details
Retrieve comprehensive station details, including ID, format (json or xml), and unit preferences (english or metric), from NOAA Tides and Currents API for accurate data analysis.
Instructions
Get detailed information about a station
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output format (json, xml) | |
| station | Yes | Station ID | |
| units | No | Units to use ("english" or "metric") |
Implementation Reference
- src/services/noaa-service.ts:165-170 (handler)Core implementation of get_station_details: fetches station metadata from NOAA API endpoint /stations/{station}/details using provided parameters.async getStationDetails(params: Record<string, any>): Promise<any> { const { station, ...rest } = params; const endpoint = `/stations/${station}/details.` + (rest.format || 'json'); return this.fetchMetadataApi(endpoint, rest); }
- src/interfaces/noaa.ts:117-121 (schema)Zod input schema for validating parameters to get_station_details tool (station ID, units, format).export const GetStationDetailsSchema = z.object({ station: StationSchema, units: UnitsSchema, format: z.enum(['json', 'xml']).optional().describe('Output format (json, xml)'), });
- src/server/mcp-server.ts:94-101 (registration)Registration of get_station_details MCPTool in custom McpServer class, including thin handler delegating to NoaaService.getStationDetails.const getStationDetails: MCPTool = { name: "get_station_details", description: "Get detailed information about a station", inputSchema: GetStationDetailsSchema, handler: async (params) => { return this.noaaService.getStationDetails(params); } };
- src/tools/station-tools.ts:37-56 (registration)Alternative registration using FastMCP.addTool with inline schema and execute handler calling NoaaService.getStationDetails.server.addTool({ name: 'get_station_details', description: 'Get detailed information about a station', parameters: z.object({ station: StationSchema, format: z.enum(['json', 'xml']).optional().describe('Output format (json, xml)'), units: UnitsSchema, }), execute: async (params) => { try { const result = await noaaService.getStationDetails(params); return JSON.stringify(result); } catch (error) { if (error instanceof Error) { throw new Error(`Failed to get station details: ${error.message}`); } throw new Error('Failed to get station details'); } } });