Skip to main content
Glama
RyanCardin15

noaa-tidesandcurrents-mcp

get_stations

Retrieve a list of NOAA tide and current stations by specifying station type, output format, and units for accurate data access and integration.

Instructions

Get list of stations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNoOutput format (json, xml)
typeNoStation type (waterlevels, currents, etc.)
unitsNoUnits to use ("english" or "metric")

Implementation Reference

  • Core handler function that implements the logic to fetch NOAA stations list using metadata API with filtering, pagination, and sorting parameters.
    async getStations(params: Record<string, any>): Promise<any> {
      const { 
        type, 
        name, 
        lat_min, 
        lat_max, 
        lon_min, 
        lon_max, 
        state, 
        limit, 
        offset, 
        sort_by, 
        sort_order, 
        ...rest 
      } = params;
      
      const endpoint = '/stations.' + (rest.format || 'json');
      
      // Build query parameters with all the filters
      const queryParams: Record<string, any> = { ...rest };
      
      // Add filters only if they are defined
      if (type) queryParams.type = type;
      if (name) queryParams.name = name;
      if (lat_min !== undefined) queryParams.lat_min = lat_min;
      if (lat_max !== undefined) queryParams.lat_max = lat_max;
      if (lon_min !== undefined) queryParams.lon_min = lon_min;
      if (lon_max !== undefined) queryParams.lon_max = lon_max;
      if (state) queryParams.state = state;
      if (limit !== undefined) queryParams.limit = limit;
      if (offset !== undefined) queryParams.offset = offset;
      if (sort_by) queryParams.sort_by = sort_by;
      if (sort_order) queryParams.sort_order = sort_order;
      
      return this.fetchMetadataApi(endpoint, queryParams);
    }
  • Zod schema defining input parameters for the get_stations tool, including filters like type, location bounds, state, pagination, and sorting.
    export const GetStationsSchema = z.object({
      type: z.string().optional().describe('Station type (waterlevels, currents, etc.)'),
      units: UnitsSchema,
      format: z.enum(['json', 'xml']).optional().describe('Output format (json, xml)'),
      name: z.string().optional().describe('Filter stations by name (partial match)'),
      lat_min: z.number().optional().describe('Minimum latitude boundary'),
      lat_max: z.number().optional().describe('Maximum latitude boundary'),
      lon_min: z.number().optional().describe('Minimum longitude boundary'),
      lon_max: z.number().optional().describe('Maximum longitude boundary'),
      state: z.string().optional().describe('Filter stations by state code (e.g., CA, NY)'),
      limit: z.number().optional().describe('Maximum number of stations to return'),
      offset: z.number().optional().describe('Number of stations to skip for pagination'),
      sort_by: z.enum(['name', 'id', 'state']).optional().describe('Field to sort results by'),
      sort_order: z.enum(['asc', 'desc']).optional().describe('Sort order (ascending or descending)'),
    });
  • Registers the get_stations tool in the MCP server by defining MCPTool with name, description, input schema, and handler that delegates to NoaaService.getStations.
    const getStations: MCPTool = {
      name: "get_stations",
      description: "Get list of stations",
      inputSchema: GetStationsSchema,
      handler: async (params) => {
        return this.noaaService.getStations(params);
      }
    };
  • Alternative registration of get_stations tool using FastMCP.addTool, with inline schema and execute handler calling NoaaService.getStations.
    server.addTool({
      name: 'get_stations',
      description: 'Get list of stations',
      parameters: z.object({
        type: z.string().optional().describe('Station type (waterlevels, currents, etc.)'),
        format: z.enum(['json', 'xml']).optional().describe('Output format (json, xml)'),
        units: UnitsSchema,
      }),
      execute: async (params) => {
        try {
          const result = await noaaService.getStations(params);
          return JSON.stringify(result);
        } catch (error) {
          if (error instanceof Error) {
            throw new Error(`Failed to get stations: ${error.message}`);
          }
          throw new Error('Failed to get stations');
        }
      }
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Get list of stations' implies a read-only operation, but it doesn't disclose important behavioral traits like whether this returns all stations or a filtered subset, pagination behavior, rate limits, authentication requirements, or what the response format looks like. The description is too minimal for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just three words ('Get list of stations'), which is appropriately sized for a simple retrieval tool. It's front-loaded with the core purpose and contains zero wasted words or redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no annotations, no output schema, and operates in a context with many similar sibling tools, the description is incomplete. It doesn't explain what the tool returns, how to interpret results, or how it differs from related tools. For a retrieval tool in a rich API environment, more context is needed to guide proper usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the schema already documents all three parameters (format, type, units) with descriptions and enums. The description adds no parameter information beyond what's in the schema, so it meets the baseline of 3 where the schema does the heavy lifting, but doesn't provide additional context about how parameters interact or typical usage patterns.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get list of stations' clearly states the verb ('Get') and resource ('stations'), but it's vague about scope and doesn't differentiate from sibling tools like 'get_station_details' or 'get_water_levels'. It doesn't specify what kind of stations (e.g., water level stations, current stations) or what information is included in the list.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools available (e.g., 'get_station_details' for detailed information, 'get_water_levels' for water level data), there's no indication of when this list retrieval is appropriate versus when other tools should be used instead.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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