fetch_weather
Retrieve current weather data for a specified city using the espresso-mcp server. Input the city name to receive accurate weather details instantly.
Instructions
Fetch current weather for a city
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| city | Yes |
Implementation Reference
- src/espresso_mcp/server.py:476-482 (handler)The tool handler for 'fetch_weather'. This async function takes a city parameter, makes an HTTP GET request to a weather API, and returns the response text. It is registered via the @mcp.tool() decorator.@mcp.tool() async def fetch_weather(city: str) -> str: """Fetch current weather for a city""" async with httpx.AsyncClient() as client: response = await client.get(f"https://api.weather.com/{city}") return response.text