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
| Name | Required | Description | Default |
|---|---|---|---|
| location | Yes |
Implementation Reference
- weather__mcp_server.py:18-35 (handler)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."