Skip to main content
Glama
RyanCardin15

noaa-tidesandcurrents-mcp

get_parameter_definitions

Retrieve valid parameter values for NOAA API requests, such as time zones, datums, units, and output formats, to ensure accurate query configurations.

Instructions

Get information about valid parameter values for NOAA API requests

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
parameterNoParameter type to get information about (time_zones, datums, units, tide_intervals, current_intervals, velocity_types, products, station_types, date_formats, output_formats). If not provided, returns information about all parameter types.

Implementation Reference

  • Handler function that executes the tool logic. Parses input parameter and calls appropriate methods on NoaaParametersService to retrieve and return parameter definitions as JSON.
    execute: async (params) => {
      try {
        const { parameter } = params;
    
        // If no parameter specified, return all parameter types and their descriptions
        if (!parameter) {
          return JSON.stringify({
            time_zones: parametersService.getTimeZones(),
            datums: parametersService.getDatums(),
            units: parametersService.getUnits(),
            tide_intervals: parametersService.getTidePredictionIntervals(),
            current_intervals: parametersService.getCurrentPredictionIntervals(),
            velocity_types: parametersService.getVelocityTypes(),
            products: parametersService.getMeteorologicalProducts(),
            station_types: parametersService.getStationTypes(),
            date_formats: parametersService.getDateFormats(),
            output_formats: parametersService.getOutputFormats()
          });
        }
    
        // Return specific parameter information based on the parameter type
        let result;
        switch (parameter) {
          case 'time_zones':
            result = parametersService.getTimeZones();
            break;
          case 'datums':
            result = parametersService.getDatums();
            break;
          case 'units':
            result = parametersService.getUnits();
            break;
          case 'tide_intervals':
            result = parametersService.getTidePredictionIntervals();
            break;
          case 'current_intervals':
            result = parametersService.getCurrentPredictionIntervals();
            break;
          case 'velocity_types':
            result = parametersService.getVelocityTypes();
            break;
          case 'products':
            result = parametersService.getMeteorologicalProducts();
            break;
          case 'station_types':
            result = parametersService.getStationTypes();
            break;
          case 'date_formats':
            result = parametersService.getDateFormats();
            break;
          case 'output_formats':
            result = parametersService.getOutputFormats();
            break;
          default:
            throw new Error(`Unknown parameter type: ${parameter}`);
        }
    
        return JSON.stringify(result);
      } catch (error) {
        if (error instanceof Error) {
          throw new Error(`Failed to get parameter definitions: ${error.message}`);
        }
        throw new Error('Failed to get parameter definitions');
      }
    }
  • Zod schema defining the input parameters for the tool: optional 'parameter' string specifying the type of parameter definitions to retrieve.
    export const ParameterSchema = z.object({
      parameter: z.string().optional().describe('Parameter type to get information about (time_zones, datums, units, tide_intervals, current_intervals, velocity_types, products, station_types, date_formats, output_formats). If not provided, returns information about all parameter types.')
    });
  • Tool registration via server.addTool in registerParameterTools function, which defines name, description, parameters schema, and execute handler.
    server.addTool({
      name: 'get_parameter_definitions',
      description: 'Get information about valid parameter values for NOAA API requests',
      parameters: ParameterSchema,
      execute: async (params) => {
        try {
          const { parameter } = params;
    
          // If no parameter specified, return all parameter types and their descriptions
          if (!parameter) {
            return JSON.stringify({
              time_zones: parametersService.getTimeZones(),
              datums: parametersService.getDatums(),
              units: parametersService.getUnits(),
              tide_intervals: parametersService.getTidePredictionIntervals(),
              current_intervals: parametersService.getCurrentPredictionIntervals(),
              velocity_types: parametersService.getVelocityTypes(),
              products: parametersService.getMeteorologicalProducts(),
              station_types: parametersService.getStationTypes(),
              date_formats: parametersService.getDateFormats(),
              output_formats: parametersService.getOutputFormats()
            });
          }
    
          // Return specific parameter information based on the parameter type
          let result;
          switch (parameter) {
            case 'time_zones':
              result = parametersService.getTimeZones();
              break;
            case 'datums':
              result = parametersService.getDatums();
              break;
            case 'units':
              result = parametersService.getUnits();
              break;
            case 'tide_intervals':
              result = parametersService.getTidePredictionIntervals();
              break;
            case 'current_intervals':
              result = parametersService.getCurrentPredictionIntervals();
              break;
            case 'velocity_types':
              result = parametersService.getVelocityTypes();
              break;
            case 'products':
              result = parametersService.getMeteorologicalProducts();
              break;
            case 'station_types':
              result = parametersService.getStationTypes();
              break;
            case 'date_formats':
              result = parametersService.getDateFormats();
              break;
            case 'output_formats':
              result = parametersService.getOutputFormats();
              break;
            default:
              throw new Error(`Unknown parameter type: ${parameter}`);
          }
    
          return JSON.stringify(result);
        } catch (error) {
          if (error instanceof Error) {
            throw new Error(`Failed to get parameter definitions: ${error.message}`);
          }
          throw new Error('Failed to get parameter definitions');
        }
      }
    });
  • Invocation of registerParameterTools within registerAllTools, passing the MCP server and NoaaParametersService instance to register the tool.
    registerParameterTools(server, parametersService);
  • Service class providing all the parameter definition data via hardcoded arrays of valid values and descriptions, used by the tool handler.
    export class NoaaParametersService {
      /**
       * Get valid time zone values
       */
      getTimeZones(): { id: string, description: string }[] {
        return [
          { id: 'gmt', description: 'Greenwich Mean Time' },
          { id: 'lst', description: 'Local Standard Time' },
          { id: 'lst_ldt', description: 'Local Standard/Local Daylight Time' }
        ];
      }
    
      /**
       * Get valid datum values
       */
      getDatums(): { id: string, description: string }[] {
        return [
          { id: 'MHHW', description: 'Mean Higher High Water' },
          { id: 'MHW', description: 'Mean High Water' },
          { id: 'MTL', description: 'Mean Tide Level' },
          { id: 'MSL', description: 'Mean Sea Level' },
          { id: 'MLW', description: 'Mean Low Water' },
          { id: 'MLLW', description: 'Mean Lower Low Water' },
          { id: 'NAVD', description: 'North American Vertical Datum' },
          { id: 'STND', description: 'Station Datum' }
        ];
      }
    
      /**
       * Get valid units
       */
      getUnits(): { id: string, description: string }[] {
        return [
          { id: 'english', description: 'English units (feet, mph, etc.)' },
          { id: 'metric', description: 'Metric units (meters, kph, etc.)' }
        ];
      }
    
      /**
       * Get valid intervals for tide predictions
       */
      getTidePredictionIntervals(): { id: string, description: string }[] {
        return [
          { id: 'hilo', description: 'High/low tide predictions only' },
          { id: 'h', description: 'Hourly predictions' },
          { id: '6', description: '6-minute predictions' },
          { id: '30', description: '30-minute predictions' },
          { id: '60', description: '60-minute predictions' }
        ];
      }
    
      /**
       * Get valid intervals for current predictions
       */
      getCurrentPredictionIntervals(): { id: string, description: string }[] {
        return [
          { id: 'MAX_SLACK', description: 'Maximum flood/ebb and slack predictions only' },
          { id: '6', description: '6-minute predictions' },
          { id: '30', description: '30-minute predictions' },
          { id: '60', description: '60-minute predictions' }
        ];
      }
    
      /**
       * Get valid velocity types for current predictions
       */
      getVelocityTypes(): { id: string, description: string }[] {
        return [
          { id: 'default', description: 'Default velocity reporting (flood/ebb direction)' },
          { id: 'speed_dir', description: 'Speed and direction format' }
        ];
      }
    
      /**
       * Get valid meteorological products
       */
      getMeteorologicalProducts(): { id: string, description: string }[] {
        return [
          { id: 'air_temperature', description: 'Air temperature' },
          { id: 'water_temperature', description: 'Water temperature' },
          { id: 'wind', description: 'Wind speed and direction' },
          { id: 'air_pressure', description: 'Barometric pressure' },
          { id: 'air_gap', description: 'Air gap (distance between bridge and water surface)' },
          { id: 'conductivity', description: 'Conductivity' },
          { id: 'visibility', description: 'Visibility' },
          { id: 'humidity', description: 'Relative humidity' },
          { id: 'salinity', description: 'Salinity' },
          { id: 'hourly_height', description: 'Verified hourly height water level' },
          { id: 'high_low', description: 'Verified high/low water level' },
          { id: 'daily_mean', description: 'Verified daily mean water level' },
          { id: 'monthly_mean', description: 'Verified monthly mean water level' },
          { id: 'one_minute_water_level', description: 'One-minute water level data' },
          { id: 'datums', description: 'Datums' }
        ];
      }
    
      /**
       * Get valid station types
       */
      getStationTypes(): { id: string, description: string }[] {
        return [
          { id: 'waterlevels', description: 'Water level stations' },
          { id: 'currentpredictions', description: 'Current prediction stations' },
          { id: 'currents', description: 'Current observation stations' },
          { id: 'tidepredictions', description: 'Tide prediction stations' },
          { id: 'weather', description: 'Weather stations' },
          { id: 'ports', description: 'Physical Oceanographic Real-Time System (PORTS) stations' }
        ];
      }
    
      /**
       * Get valid date formats
       */
      getDateFormats(): { format: string, description: string, example: string }[] {
        return [
          { format: 'YYYYMMDD', description: 'Year, month, day without separators', example: '20230401' },
          { format: 'MM/DD/YYYY', description: 'Month/day/year with separators', example: '04/01/2023' },
          { format: 'today', description: 'Current date', example: 'today' },
          { format: 'latest', description: 'Latest available data', example: 'latest' },
          { format: 'recent', description: 'Most recent data', example: 'recent' }
        ];
      }
    
      /**
       * Get valid output formats
       */
      getOutputFormats(): { id: string, description: string }[] {
        return [
          { id: 'json', description: 'JSON format' },
          { id: 'xml', description: 'XML format' },
          { id: 'csv', description: 'CSV format (not available for all endpoints)' }
        ];
      }
    } 
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. It states the tool 'Get information' but doesn't specify whether this is a read-only operation, if it requires authentication, rate limits, or what the return format looks like (e.g., JSON structure). For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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 a single, clear sentence that efficiently conveys the tool's purpose without any wasted words. It is appropriately sized and front-loaded, making it easy to understand at a glance.

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

Completeness3/5

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

Given the tool's low complexity (1 optional parameter, no nested objects) and high schema description coverage, the description is adequate but incomplete. It lacks details on behavioral aspects (e.g., read-only nature, output format) and there's no output schema, leaving gaps in understanding what information is returned. It meets minimum viability but has clear room for improvement.

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?

The input schema has 100% description coverage, with the single parameter 'parameter' well-documented in the schema itself. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't explain the significance of the parameter types listed). With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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

Purpose4/5

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

The description clearly states the tool's purpose with a specific verb ('Get information about') and resource ('valid parameter values for NOAA API requests'). It distinguishes itself from sibling tools that fetch actual data (e.g., get_current_predictions, get_tide_predictions) by focusing on metadata about parameter values. However, it doesn't explicitly name the sibling tools it differs from, which prevents a perfect score.

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

Usage Guidelines3/5

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

The description implies usage context by mentioning 'NOAA API requests' and the input schema suggests this tool helps understand valid values for other API calls. However, it lacks explicit guidance on when to use this tool versus alternatives (e.g., before making other NOAA API calls to validate parameters) or any exclusions. The context is clear but not fully articulated.

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