Skip to main content
Glama
RyanCardin15

LocalTides MCP Server

get_moon_phases_range

Retrieve moon phase data for a specific date range and location using start and end dates, latitude, longitude, and preferred output format (JSON or text).

Instructions

Get moon phase information for a date range

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
end_dateYesEnd date (YYYY-MM-DD format)
formatNoOutput format (json or text)
latitudeNoLatitude for location-specific calculations
longitudeNoLongitude for location-specific calculations
start_dateYesStart date (YYYY-MM-DD format)

Implementation Reference

  • Core handler function that computes moon phases over a date range by iterating daily and calling getMoonPhase.
    getMoonPhasesRange(params: MoonPhasesRangeParams): MoonPhaseInfo[] {
      const startDate = new Date(params.start_date);
      const endDate = new Date(params.end_date);
      
      if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
        throw new Error('Invalid date format. Please use YYYY-MM-DD format.');
      }
      
      if (startDate > endDate) {
        throw new Error('Start date must be before end date.');
      }
      
      const result: MoonPhaseInfo[] = [];
      const currentDate = new Date(startDate);
      
      while (currentDate <= endDate) {
        result.push(this.getMoonPhase({
          date: currentDate.toISOString().split('T')[0],
          latitude: params.latitude,
          longitude: params.longitude
        }));
        
        // Move to next day
        currentDate.setDate(currentDate.getDate() + 1);
      }
      
      return result;
    }
  • Tool registration in FastMCP server, including name, description, input schema, and execute handler that wraps the service call and handles formatting/errors.
    server.addTool({
      name: 'get_moon_phases_range',
      description: 'Get moon phase information for a date range',
      parameters: MoonPhasesRangeParamsSchema,
      execute: async (params) => {
        try {
          const results = moonPhaseService.getMoonPhasesRange(params);
          if (params.format === 'text') {
            return results.map(result => 
              `${result.date}: ${result.phaseName} (${(result.illumination * 100).toFixed(1)}% illuminated)`
            ).join('\n');
          }
          return JSON.stringify(results);
        } catch (error) {
          if (error instanceof Error) {
            throw new Error(`Failed to get moon phases: ${error.message}`);
          }
          throw new Error('Failed to get moon phases');
        }
      }
    });
  • Zod schema defining the input parameters for the get_moon_phases_range tool.
    export const MoonPhasesRangeParamsSchema = z.object({
      start_date: z.string().describe('Start date (YYYY-MM-DD format)'),
      end_date: z.string().describe('End date (YYYY-MM-DD format)'),
      latitude: z.number().min(-90).max(90).optional().describe('Latitude for location-specific calculations'),
      longitude: z.number().min(-180).max(180).optional().describe('Longitude for location-specific calculations'),
      format: z.enum(['json', 'text']).optional().describe('Output format (json or text)')
    });
Behavior2/5

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

With no annotations provided, the description carries full burden but only states what the tool does without behavioral details. It doesn't disclose whether this is a read-only operation, what authentication might be needed, rate limits, error conditions, or what the output looks like (though there's no output schema).

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, efficient sentence with zero waste. It's appropriately sized and front-loaded with the core purpose.

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?

For a tool with 5 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain the optional latitude/longitude parameters for location-specific calculations, output format implications, or behavioral aspects like whether calculations are geocentric by default.

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?

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds no additional parameter semantics beyond implying date range usage. Baseline 3 is appropriate when the schema does the heavy lifting.

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 verb ('Get') and resource ('moon phase information') with the scope ('for a date range'). It distinguishes from sibling 'get_moon_phase' by specifying range vs. single date. However, it doesn't explicitly mention location-specific calculations which are part of the input schema.

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?

No guidance is provided about when to use this tool versus alternatives like 'get_moon_phase' (for single dates) or 'get_next_moon_phase' (for upcoming phases). The description implies usage for date ranges but doesn't specify exclusions or prerequisites.

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-TidesAndCurrents-MCP'

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