Skip to main content
Glama

get_coordinates

Retrieve latitude and longitude for any specified city using the get_coordinates tool on the MCP Weather Server.

Instructions

Returns the latitude and longitude of the specified city as a tuple. Args: city: the city of

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityYes

Implementation Reference

  • The main handler function for the 'get_coordinates' tool. It takes a city name and returns hardcoded latitude and longitude coordinates (San Francisco). Intended to be replaced with a real API call.
    def get_coordinates(city: str) -> Tuple[float, float]: """ Returns the latitude and longitude of the specified city as a tuple. Args: city: the city of """ # Hardcode replace it with you api to get the latitude and longitude of any city return (37.7749, -122.4194)
  • The decorator that registers the get_coordinates function as an MCP tool within the register(mcp) function.
    @mcp.tool()
  • Type hints defining the input schema (city: str) and output schema (Tuple[float, float]) for the tool.
    def get_coordinates(city: str) -> Tuple[float, float]:

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/jeannassereldine/mcp-server'

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