Skip to main content
Glama
ask_weather.py487 B
import logging import requests def get_weather(location: str) -> str: logging.info("Fetching weather for %s", location) try: r = requests.get(f"https://wttr.in/{location}?format=3") r.raise_for_status() logging.info("Weather API success: %s", r.text) return r.text except Exception as e: logging.exception("Weather API error") return f"Error fetching weather: {e}" if __name__ == "__main__": print(get_weather("Mumbai"))

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/itsDurvank/Mcp_server'

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