Skip to main content
Glama
nictuku

Python MCP Server Template

by nictuku

get_weather

Retrieve weather data for a specified city using a Python MCP server, enabling integration with applications like Claude Desktop or Cursor for context-aware weather queries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityYes

Implementation Reference

  • The get_weather tool handler, decorated with @mcp.tool(), fetches the weather for a given city from the wttr.in API and returns a formatted string.
    @mcp.tool() async def get_weather(city: str) -> str: response = httpx.get(f"https://wttr.in/{city}?format=3") return response.text
  • mcp_server.py:17-17 (registration)
    Registration of the get_weather tool using the @mcp.tool() decorator.
    @mcp.tool()
  • Input schema: city (str), Output: str (weather info).
    async def get_weather(city: str) -> str:

Other Tools

Related 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