Skip to main content
Glama
sritajkumarpatel

Weather Service MCP

get_weather

Retrieve current weather conditions for any city or location using the Weather Service MCP tool. Provide a location name to get real-time weather data.

Instructions

Get the current weather for a given location.

Args: location: The name of the city or location to get weather for

Returns: A string describing the current weather conditions

Note: This is a mock implementation. In production, integrate with a real weather API like OpenWeatherMap, WeatherAPI, or similar services.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
locationYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The get_weather tool handler function, decorated with @mcp.tool(). It takes a location string and returns mock weather data.
    @mcp.tool()
    def get_weather(location: str) -> str:
        """
        Get the current weather for a given location.
        
        Args:
            location: The name of the city or location to get weather for
            
        Returns:
            A string describing the current weather conditions
            
        Note:
            This is a mock implementation. In production, integrate with a real
            weather API like OpenWeatherMap, WeatherAPI, or similar services.
        """
        # In a real implementation, this function would call a weather API.
        return f"The current weather in {location} is sunny with a temperature of 25°C."
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. It states it's a mock implementation and suggests real API integration, which hints at limitations but lacks details on behavior like error handling, data freshness, or authentication needs. It does not disclose critical traits like rate limits or response format beyond a vague 'string describing conditions'.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (Args, Returns, Note) and front-loaded purpose. It is appropriately sized, but the note about mock implementation, while useful, adds length that might not be essential for tool invocation by an AI agent.

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 and the presence of an output schema (though not detailed here), the description is minimally adequate. It covers purpose and parameters but lacks behavioral context and usage guidelines. With no annotations and simple schema, it should do more to explain expected outputs and constraints.

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 schema description coverage is 0%, but the description compensates by explaining the 'location' parameter as 'The name of the city or location to get weather for', adding meaning beyond the bare schema. However, it does not provide examples, constraints, or format details, keeping it at a baseline level.

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 with a specific verb ('Get') and resource ('current weather for a given location'). It distinguishes what it does (retrieve current weather) without being tautological. However, since there are no sibling tools mentioned, it cannot demonstrate differentiation 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. It does not mention any prerequisites, constraints, or scenarios where this tool is preferred. The note about mock implementation and production integration is technical, not usage-related for an AI agent.

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/sritajkumarpatel/learn_mcp_2025'

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