Skip to main content
Glama
APOGEOAPI
by APOGEOAPI

geolocate_ip

Find geographic location details for any IP address, including country, city, coordinates, timezone, and EU membership status.

Instructions

Geolocate an IPv4 or IPv6 address — returns country, region, city, coordinates, timezone, and EU membership. Requires Starter plan or above.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesIPv4 or IPv6 address to geolocate (e.g. 8.8.8.8 or 2001:4860:4860::8888)

Implementation Reference

  • The geolocate_ip tool handler implementation, which calls the apiGet helper function.
    server.tool(
      'geolocate_ip',
      'Geolocate an IPv4 or IPv6 address — returns country, region, city, coordinates, timezone, and EU membership. Requires Starter plan or above.',
      {
        address: z.string().describe('IPv4 or IPv6 address to geolocate (e.g. 8.8.8.8 or 2001:4860:4860::8888)'),
      },
      async ({ address }) => {
        const data = await apiGet(`/v1/api/geo/ip/${address}`);
        return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
      }
    );
  • src/tools/ip.ts:5-17 (registration)
    Registration function for the geolocate_ip tool within the McpServer.
    export function registerIpTools(server: McpServer) {
      server.tool(
        'geolocate_ip',
        'Geolocate an IPv4 or IPv6 address — returns country, region, city, coordinates, timezone, and EU membership. Requires Starter plan or above.',
        {
          address: z.string().describe('IPv4 or IPv6 address to geolocate (e.g. 8.8.8.8 or 2001:4860:4860::8888)'),
        },
        async ({ address }) => {
          const data = await apiGet(`/v1/api/geo/ip/${address}`);
          return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
        }
      );
    }

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/APOGEOAPI/apogeoapi-mcp'

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