Skip to main content
Glama

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
NameRequiredDescriptionDefault
cityYes

Implementation Reference

  • 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

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/vs4vijay/espresso-mcp'

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