Skip to main content
Glama

get_station_details

Retrieve detailed station information, including ID, output format (JSON/XML), and units (English/Metric), for accurate water level and tide 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

  • Implements the core logic to fetch detailed station information from NOAA's metadata API by constructing the endpoint `/stations/{station}/details.{format}` and calling fetchMetadataApi.
    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); }
  • Registers the get_station_details tool in the McpServer class using the MCPTool interface, with schema validation and delegation to NoaaService.
    const getStationDetails: MCPTool = { name: "get_station_details", description: "Get detailed information about a station", inputSchema: GetStationDetailsSchema, handler: async (params) => { return this.noaaService.getStationDetails(params); } };
  • Zod schema defining input parameters for get_station_details: required station ID, optional units (english/metric), optional format (json/xml).
    export const GetStationDetailsSchema = z.object({ station: StationSchema, units: UnitsSchema, format: z.enum(['json', 'xml']).optional().describe('Output format (json, xml)'), });
  • Alternative registration of get_station_details tool using FastMCP's addTool method, with inline Zod parameters schema, error handling, and JSON stringification of result.
    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-TidesAndCurrents-MCP'

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