Skip to main content
Glama
robertn702

OpenWeatherMap MCP Server

get-minutely-forecast

Retrieve minute-by-minute precipitation forecasts for the next hour using location data. Input a city name or coordinates to access detailed weather predictions for up to 60 minutes.

Instructions

Get minute-by-minute precipitation forecast for next hour

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of minutes to forecast (1-60, default: 60)
locationYesCity name (e.g., 'New York') or coordinates (e.g., 'lat,lon')

Implementation Reference

  • The execute handler function implementing the core logic for the get-minutely-forecast tool: resolves location, fetches minutely precipitation forecast from OpenWeatherMap API, formats the response as JSON with precipitation amounts and descriptions.
    execute: async (args, { session, log }) => {
      try {
        log.info("Getting minutely weather forecast", { 
          location: args.location,
          limit: args.limit
        });
        
        // Get OpenWeather client
        const client = getOpenWeatherClient(session as SessionData | undefined);
        
        // Configure client for this request
        configureClientForLocation(client, args.location);
        
        // Fetch minutely forecast data
        const requestedMinutes = args.limit || 60;
        const minutelyData = await client.getMinutelyForecast(requestedMinutes);
        
        log.info("Successfully retrieved minutely weather forecast", { 
          location: args.location,
          minutes: minutelyData.length
        });
        
        // Format the response
        const formattedForecast = JSON.stringify({
          location: args.location,
          minutes_requested: requestedMinutes,
          forecast: minutelyData.map((minute, index) => ({
            minute_offset: index + 1,
            time: minute.dt.toISOString(),
            precipitation: minute.weather.rain,
            precipitation_description: minute.weather.rain > 0 ? 
              (minute.weather.rain < 0.1 ? 'Light rain' : 
               minute.weather.rain < 0.5 ? 'Moderate rain' : 'Heavy rain') : 'No precipitation'
          }))
        }, null, 2);
        
        return {
          content: [
            {
              type: "text",
              text: formattedForecast
            }
          ]
        };
      } catch (error) {
        log.error("Failed to get minutely weather forecast", { 
          error: error instanceof Error ? error.message : 'Unknown error' 
        });
        
        // Provide helpful error messages
        if (error instanceof Error) {
          if (error.message.includes('city not found')) {
            throw new Error(`Location "${args.location}" not found. Please check the spelling or try using coordinates.`);
          }
          if (error.message.includes('Invalid API key')) {
            throw new Error('Invalid OpenWeatherMap API key. Please check your configuration.');
          }
        }
        
        throw new Error(`Failed to get minutely weather forecast: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • src/main.ts:381-447 (registration)
    Registration of the get-minutely-forecast tool using server.addTool, including name, description, input schema, and execute handler.
    server.addTool({
      name: "get-minutely-forecast",
      description: "Get minute-by-minute precipitation forecast for next hour",
      parameters: getMinutelyForecastSchema,
      execute: async (args, { session, log }) => {
        try {
          log.info("Getting minutely weather forecast", { 
            location: args.location,
            limit: args.limit
          });
          
          // Get OpenWeather client
          const client = getOpenWeatherClient(session as SessionData | undefined);
          
          // Configure client for this request
          configureClientForLocation(client, args.location);
          
          // Fetch minutely forecast data
          const requestedMinutes = args.limit || 60;
          const minutelyData = await client.getMinutelyForecast(requestedMinutes);
          
          log.info("Successfully retrieved minutely weather forecast", { 
            location: args.location,
            minutes: minutelyData.length
          });
          
          // Format the response
          const formattedForecast = JSON.stringify({
            location: args.location,
            minutes_requested: requestedMinutes,
            forecast: minutelyData.map((minute, index) => ({
              minute_offset: index + 1,
              time: minute.dt.toISOString(),
              precipitation: minute.weather.rain,
              precipitation_description: minute.weather.rain > 0 ? 
                (minute.weather.rain < 0.1 ? 'Light rain' : 
                 minute.weather.rain < 0.5 ? 'Moderate rain' : 'Heavy rain') : 'No precipitation'
            }))
          }, null, 2);
          
          return {
            content: [
              {
                type: "text",
                text: formattedForecast
              }
            ]
          };
        } catch (error) {
          log.error("Failed to get minutely weather forecast", { 
            error: error instanceof Error ? error.message : 'Unknown error' 
          });
          
          // Provide helpful error messages
          if (error instanceof Error) {
            if (error.message.includes('city not found')) {
              throw new Error(`Location "${args.location}" not found. Please check the spelling or try using coordinates.`);
            }
            if (error.message.includes('Invalid API key')) {
              throw new Error('Invalid OpenWeatherMap API key. Please check your configuration.');
            }
          }
          
          throw new Error(`Failed to get minutely weather forecast: ${error instanceof Error ? error.message : 'Unknown error'}`);
        }
      }
    });
  • Zod schema defining the input parameters for the get-minutely-forecast tool: location (string) and optional limit (number 1-60).
    export const getMinutelyForecastSchema = z.object({
      location: z.string().describe("City name (e.g., 'New York') or coordinates (e.g., 'lat,lon')"),
      limit: z.number().min(1).max(60).optional().describe("Number of minutes to forecast (1-60, default: 60)"),
    });
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 returns a forecast but doesn't describe key behavioral traits such as data format, potential errors (e.g., invalid location), rate limits, authentication needs, or whether it's a read-only operation. For a tool with no annotation coverage, this is a significant gap in transparency.

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, front-loaded sentence: 'Get minute-by-minute precipitation forecast for next hour.' It efficiently conveys the core purpose without unnecessary words, making it easy for an agent to parse. Every part of the sentence earns its place by specifying key details like granularity and resource.

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 complexity of a weather forecasting tool with no annotations and no output schema, the description is incomplete. It lacks information on behavioral aspects (e.g., error handling, data format), usage context relative to siblings, and output details. While the schema covers parameters well, the overall context for effective tool invocation is insufficient, especially for a tool that likely returns structured data.

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 clear documentation for both parameters ('limit' and 'location'), including constraints and examples. The description doesn't add any semantic details beyond what the schema provides (e.g., it doesn't explain how 'location' affects the forecast or the meaning of 'precipitation' in the output). Since schema coverage is high, 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: 'Get minute-by-minute precipitation forecast for next hour.' It specifies the action ('Get'), resource ('precipitation forecast'), and temporal scope ('minute-by-minute... for next hour'), which is specific and informative. However, it doesn't explicitly distinguish this tool from sibling tools like 'get-hourly-forecast' or 'get-daily-forecast' in terms of granularity or precipitation focus, missing full sibling differentiation.

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. It doesn't mention sibling tools like 'get-hourly-forecast' or 'get-daily-forecast' for comparison, nor does it specify use cases or exclusions (e.g., when precipitation data is needed vs. general weather). This leaves the agent without context for tool selection among similar weather-related options.

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/robertn702/mcp-openweathermap'

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