Skip to main content
Glama

get_my_location

Retrieve your current geographic location using your IP address to determine your position for location-based services and applications.

Instructions

Get the location of the current IP address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function in the APIRequest class that fetches the current IP location by making an API request to /me endpoint.
    async getMyLocation(): Promise<IPFindIPResponse> { return await this.makeRequest<IPFindIPResponse>(`/me?auth=${this.apiKey}`); }
  • Input schema definition for the get_my_location tool in the ListTools response, specifying no input parameters.
    { name: "get_my_location", description: "Get the location of the current IP address", inputSchema: { type: "object", properties: {}, }, },
  • src/index.ts:100-115 (registration)
    Registration and dispatching logic in the CallToolRequest handler that routes requests for get_my_location to the handler and formats the JSON response.
    if (request.params.name === "get_my_location") { const output = await ipfind.apiRequest.getMyLocation(); if (!output) { throw new Error("Failed to fetch my location."); } return { content: [ { type: "text", text: JSON.stringify(output, null, 2), }, ], }; }
  • TypeScript type definition for IPFindIPResponse, which defines the structure of the output from get_my_location.
    ip_address: string; country: string | null; country_code: string | null; continent: string | null; continent_code: string | null; city: string | null; county: string | null; region: string | null; region_code: string | null; postal_code: string | null; timezone: string | null; owner: string | null; longitude: number; latitude: number; currency: string | null; languages: string[]; };

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

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