Skip to main content
Glama
shtansky-bikeleasing

Weather MCP Server

get_weather

Retrieve current weather conditions including temperature, humidity, wind speed, and atmospheric pressure for any city worldwide.

Instructions

Get current weather for a city

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityYesName of the city to get weather for

Implementation Reference

  • index.js:85-113 (handler)
    The main handler function that fetches current weather data for a given city using the OpenWeatherMap API via axios, formats the response as MCP content, and handles errors.
        async getWeather(city) {
            if (!API_KEY) {
                throw new Error("OpenWeatherMap API key not found. Set OPENWEATHER_API_KEY environment variable.");
            }
    
            try {
                const response = await axios.get(
                    `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${API_KEY}&units=metric`
                );
    
                const weather = response.data;
    
                return {
                    content: [
                        {
                            type: "text",
                            text: `Weather in ${weather.name}, ${weather.sys.country}:
    Temperature: ${weather.main.temp}°C (feels like ${weather.main.feels_like}°C)
    Condition: ${weather.weather[0].description}
    Humidity: ${weather.main.humidity}%
    Wind: ${weather.wind.speed} m/s
    Pressure: ${weather.main.pressure} hPa`,
                        },
                    ],
                };
            } catch (error) {
                throw new Error(`Failed to get weather for ${city}: ${error.message}`);
            }
        }
  • Input schema definition for the get_weather tool, specifying a required 'city' string parameter.
    inputSchema: {
        type: "object",
        properties: {
            city: {
                type: "string",
                description: "Name of the city to get weather for",
            },
        },
        required: ["city"],
    },
  • index.js:34-47 (registration)
    Registration of the get_weather tool in the ListToolsRequestSchema handler, including name, description, and input schema.
    {
        name: "get_weather",
        description: "Get current weather for a city",
        inputSchema: {
            type: "object",
            properties: {
                city: {
                    type: "string",
                    description: "Name of the city to get weather for",
                },
            },
            required: ["city"],
        },
    },
  • index.js:73-75 (registration)
    Dispatch/registration logic in the CallToolRequestSchema handler that checks the tool name and invokes the getWeather handler.
    if (name === "get_weather") {
        return await this.getWeather(args.city);
    }
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 'Get current weather' but doesn't specify aspects like rate limits, error handling, data sources, or whether it requires authentication. For a tool with no annotations, this is a significant gap in transparency about how it behaves.

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 is front-loaded with the core purpose. There is no wasted language or unnecessary elaboration, making it easy to parse quickly. It earns its place by clearly stating the tool's function without redundancy.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns, potential errors, or behavioral traits. For a tool with no structured data to rely on, the description should provide more context to help the agent use it effectively, but it falls short.

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 'city' parameter fully documented. The description adds no additional meaning beyond the schema, such as format examples or constraints. According to the rules, when schema coverage is high (>80%), the baseline score is 3, as 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 ('current weather for a city'), making the purpose immediately understandable. However, it doesn't differentiate from the sibling tool 'send_notification', which is unrelated, so this doesn't impact the score negatively. The description avoids tautology by specifying what is being retrieved.

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, such as other weather-related tools that might exist in a broader context. It only states what the tool does, without mentioning prerequisites, limitations, or scenarios for use. This leaves the agent with minimal context for decision-making.

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/shtansky-bikeleasing/weather-mcp-server'

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