Skip to main content
Glama

get_ip_location

Retrieve geographic location data for any IP address to identify user regions or analyze network traffic origins.

Instructions

Get the location of an IP address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipAddressNoThe IP address to get the location of.

Implementation Reference

  • Handler logic for the 'get_ip_location' tool within the CallToolRequestSchema handler. It extracts the ipAddress from arguments, calls the helper, handles errors, and returns the result as formatted JSON text.
    if (request.params.name === "get_ip_location") {
      const input = request.params.arguments as { ipAddress: string };
      const output = await ipfind.apiRequest.getIPLocation(input.ipAddress);
    
      if (!output) {
        throw new Error("Failed to fetch IP location.");
      }
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(output, null, 2),
          },
        ],
      };
    }
  • Schema definition for the 'get_ip_location' tool, specifying the input as an object with 'ipAddress' string property.
      name: "get_ip_location",
      description: "Get the location of an IP address",
      inputSchema: {
        type: "object",
        properties: {
          ipAddress: {
            type: "string",
            description: "The IP address to get the location of.",
          },
        },
      },
    },
  • Helper method in APIRequest class that makes the HTTP request to IPFind API for the given IP address location.
    async getIPLocation(ip: string): Promise<IPFindIPResponse> {
      return await this.makeRequest<IPFindIPResponse>(
        `/?auth=${this.apiKey}&ip=${ip}`
      );
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Get' implies a read operation, it doesn't specify whether this requires authentication, has rate limits, what data sources it uses, accuracy considerations, or what happens with invalid IP addresses. Significant behavioral context is missing.

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 - a single sentence that directly states the tool's function with zero wasted words. It's front-loaded and immediately communicates the core purpose without unnecessary elaboration.

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

Completeness2/5

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

For a geolocation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what location data is returned (coordinates, city, country, etc.), accuracy considerations, data source limitations, or error handling. The agent would need to guess about the tool's behavior and outputs.

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 documents the single 'ipAddress' parameter adequately. The description doesn't add any meaningful parameter semantics beyond what's in the schema, such as IP format requirements (IPv4 vs IPv6) or validation rules. Baseline 3 is appropriate when schema does the work.

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

Purpose4/5

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

The description clearly states the action ('Get') and resource ('location of an IP address'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_my_location' which appears to serve a similar location-related function, preventing a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'get_my_location' (which presumably gets the user's own location). There's no mention of prerequisites, limitations, or appropriate contexts for this IP geolocation tool.

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

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