Skip to main content
Glama

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) }] };
        }
      );
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively communicates the operation's purpose and output format, and importantly discloses the subscription requirement ('Requires Starter plan or above'), which is crucial behavioral context not captured elsewhere. It doesn't mention rate limits, error conditions, or authentication details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly concise with two tightly packed sentences. The first sentence covers purpose, input, and output. The second sentence provides critical subscription requirement. Every word earns its place with zero waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter lookup tool with no output schema, the description provides excellent context about what data is returned and subscription requirements. It could be more complete by mentioning response format or error cases, but given the tool's simplicity and lack of annotations, it's substantially complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents the single 'address' parameter with examples. The description doesn't add any parameter-specific information beyond what's in the schema, maintaining the baseline score for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Geolocate') and resource ('IPv4 or IPv6 address'), and distinguishes it from siblings by focusing on IP-based geolocation rather than country/city/currency lookups. It specifies the exact data returned (country, region, city, coordinates, timezone, EU membership).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool (for IP geolocation with detailed location data) and implicitly distinguishes it from siblings that handle broader geographic queries. However, it doesn't explicitly state when NOT to use it or name specific alternatives among the siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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

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