get_my_location
Retrieve your current geographic location using your IP address to determine position data.
Instructions
Get the location of the current IP address
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:100-115 (handler)MCP tool handler for 'get_my_location': checks tool name, calls ipfind.apiRequest.getMyLocation(), handles error, returns 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/index.ts:60-67 (registration)Registration of 'get_my_location' tool in ListToolsRequestSchema handler, including name, description, and empty input schema.{ name: "get_my_location", description: "Get the location of the current IP address", inputSchema: { type: "object", properties: {}, }, },
- src/ipfind.ts:38-40 (helper)Helper method in APIRequest class that performs the actual API call to retrieve the current IP location using the /me endpoint.async getMyLocation(): Promise<IPFindIPResponse> { return await this.makeRequest<IPFindIPResponse>(`/me?auth=${this.apiKey}`); }