Skip to main content
Glama
nictuku

Python MCP Server Template

by nictuku

get_weather

Retrieve current weather data for any specified city using this Python MCP server tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityYes

Implementation Reference

  • mcp_server.py:17-17 (registration)
    Decorator that registers the get_weather function as a tool in the MCP server.
    @mcp.tool()
  • The main handler function implementing the get_weather tool logic by querying the wttr.in API for the specified city.
    async def get_weather(city: str) -> str: response = httpx.get(f"https://wttr.in/{city}?format=3") return response.text
  • Type hints define the input schema (city: str) and output (str).
    async def get_weather(city: str) -> str:

Other Tools

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/nictuku/py-mcp-server-template'

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