Skip to main content
Glama
Sukruthr

Weather MCP Server

by Sukruthr

fetch_weather

Retrieve current weather conditions and temperature data for any specified location worldwide using real-time weather information.

Instructions

Get weather information for a given location

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
locationYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:7-13 (handler)
    The handler function for the 'fetch_weather' tool, registered via @mcp.tool() decorator. It takes a location string and returns the weather by delegating to the get_weather helper.
    @mcp.tool()
    async def fetch_weather(location: str) -> str:
        
        """
        Get weather information for a given location
        """
        return get_weather(location)
  • Helper function containing the core logic to fetch weather data from wttr.in API using urllib, with error handling.
    def get_weather(location:str) -> str:
    
        """
        fetches the weather for a given location, example: "London, new-york, San-francisco, etc."
    
        Args:
            location(str): the city or location name to fetch the weather for.
    
        Returns:
            str: a string containing the weather for the location    
        
        """
    
        try:
            url = f"https://wttr.in/{location}?format=3"
            with urllib.request.urlopen(url) as response:
                result = response.read().decode('utf-8').strip()
                return result
        except Exception as e:
            return f"Error fetching weather: {e}"
Behavior1/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 only states the basic function without mentioning any behavioral traits like rate limits, data sources, error handling, or response format. This leaves significant gaps in understanding how the tool behaves beyond its core purpose.

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 extremely concise with a single sentence that directly states the tool's purpose. It is front-loaded and wastes no words, making it easy to parse quickly.

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 parameter) and the presence of an output schema, the description is minimally adequate. However, it lacks details on behavioral aspects and parameter semantics, which are important even for simple tools. The output schema helps, but the description doesn't fully cover the tool's context without annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, meaning the input schema provides no descriptions for parameters. The description mentions 'for a given location,' which hints at the 'location' parameter but adds minimal semantic value—it doesn't clarify what format the location should be in (e.g., city name, coordinates) or any constraints. This is insufficient to compensate for the lack of schema coverage.

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 ('weather information') with the scope ('for a given location'), making the purpose specific and understandable. It doesn't need to distinguish from siblings since there are none, but it could be slightly more detailed about what weather information is provided.

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, such as prerequisites, alternatives, or specific contexts. It merely states what it does without indicating any constraints or best practices for usage.

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/Sukruthr/weather-mcp'

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