Skip to main content
Glama

get_coordinates

Convert city names to latitude and longitude coordinates for weather data retrieval and location-based applications.

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

  • Handler function for the 'get_coordinates' tool. It accepts a city name as input and returns a hardcoded tuple of latitude and longitude coordinates (San Francisco). The implementation notes to replace the hardcoded values 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)
  • Registration of the 'get_coordinates' tool using the @mcp.tool() decorator within the register(mcp) function.
    @mcp.tool() def get_coordinates(city: str) -> Tuple[float, float]:
  • Input schema: city (str). Output schema: Tuple[float, float] for latitude and longitude.
    def get_coordinates(city: str) -> Tuple[float, float]:
Install Server

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

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