Skip to main content
Glama

fetch_weather

Get current weather conditions for any city to inform planning and decision-making.

Instructions

Fetch current weather for a city

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityYes

Implementation Reference

  • The handler function for the 'fetch_weather' tool, decorated with @mcp.tool() for registration. It asynchronously fetches weather data for the given city using httpx to query a weather API endpoint.
    @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