Skip to main content
Glama

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
NameRequiredDescriptionDefault
formatNoOutput format (json, xml)
stationYesStation ID
unitsNoUnits to use ("english" or "metric")

Implementation Reference

  • 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); }
  • 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)'), });
  • 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); } };
  • 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'); } } });

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'

If you have feedback or need assistance with the MCP directory API, please join our Discord server