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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/ipfind.ts:38-40 (handler)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}`); }
- src/index.ts:60-67 (schema)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), }, ], }; }
- src/types.ts:3-19 (schema)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[]; };