Skip to main content
Glama
panchocorderos

Weather MCP Server

get-weather

Fetch current weather data for any city using the Open-Meteo API. Provide a city name to get temperature, conditions, and forecasts.

Instructions

Tool to fetch the weather for a given city

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityYesCity name

Implementation Reference

  • main.ts:18-46 (handler)
    Handler function that fetches geocoding data for the city, then retrieves current weather data from Open-Meteo API and returns it as JSON string.
    async ({ city }) => {
      const response = await fetch(`https://geocoding-api.open-meteo.com/v1/search?name=${city}&count=10&language=en&format=json`);
      const data = await response.json();
    
      if (data.results.length === 0) {
        return {
          content: [
            {
              type: "text",
              text: `No weather data found for ${city}`,
            }
          ]
        };
      }
    
      const {latitude, longitude} = data.results[0];
    
      const weatherResponse = await fetch(`https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}¤t_weather=true&precipitation=true&hourly=temperature_2m¤t=precipitation,temperature_2m,rain,is_day`);
      const weatherData = await weatherResponse.json();
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(weatherData, null, 2)
          }
        ]
      };
    }
  • main.ts:15-17 (schema)
    Zod schema defining the input parameter 'city' as a string.
    {
      city: z.string().describe("City name"),
    },
  • main.ts:12-47 (registration)
    Registration of the 'get-weather' tool using server.tool(), including name, description, input schema, and handler function.
    server.tool(
      "get-weather",
      "Tool to fetch the weather for a given city",
      {
        city: z.string().describe("City name"),
      },
      async ({ city }) => {
        const response = await fetch(`https://geocoding-api.open-meteo.com/v1/search?name=${city}&count=10&language=en&format=json`);
        const data = await response.json();
    
        if (data.results.length === 0) {
          return {
            content: [
              {
                type: "text",
                text: `No weather data found for ${city}`,
              }
            ]
          };
        }
    
        const {latitude, longitude} = data.results[0];
    
        const weatherResponse = await fetch(`https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}¤t_weather=true&precipitation=true&hourly=temperature_2m¤t=precipitation,temperature_2m,rain,is_day`);
        const weatherData = await weatherResponse.json();
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(weatherData, null, 2)
            }
          ]
        };
      }
    );
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 mentions 'fetch the weather' but fails to describe key traits like whether this is a read-only operation, potential rate limits, error handling, data freshness, or authentication needs. 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, efficient sentence that directly states the tool's function without unnecessary words. It is front-loaded with the core purpose and appropriately sized for a simple tool, making it easy for an agent to parse quickly. Every part of the sentence earns its place by conveying essential 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's simplicity (one parameter, no output schema, no annotations), the description is incomplete. It lacks details on behavioral aspects like error cases, return format, or usage context, which are crucial for an agent to invoke it correctly. While concise, it doesn't provide enough information to fully understand the tool's operation and limitations.

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 'city' documented as 'City name.' The description adds no additional meaning beyond this, such as format examples (e.g., 'New York' vs. 'NYC') or constraints. Given the high schema coverage, the baseline score of 3 is appropriate, as the schema does the heavy lifting without extra value from the description.

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 as 'fetch the weather for a given city,' which includes a specific verb ('fetch') and resource ('weather') with a clear target ('city'). It's not a tautology and communicates the basic function effectively. However, with no sibling tools mentioned, there's no opportunity to distinguish from alternatives, preventing 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 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, prerequisites, or contextual constraints. It merely states what the tool does without indicating scenarios for its application or any limitations, such as geographic availability or data sources. This lack of usage context leaves the agent without operational direction.

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

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/panchocorderos/poc-mcp'

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