Skip to main content
Glama
IPGeolocation

IP Geolocation MCP Server

lookup_network

Retrieve network details for IP addresses, including route prefix, connection type, and anycast status, using the IP Geolocation MCP Server's network lookup functionality.

Instructions

Network lookup via GET /v3/ipgeo with network only. Paid only. Cost: 1 credit. Returns route prefix, connection type, and anycast status.

Tool selection rule: use this tool for network-only requests. If the request also needs other IP domains, prefer one lookup_ip call with include plus targeted fields/excludes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipNoIPv4 or IPv6 address to look up. Omit to check the caller's IP.
force_refreshNoDefault false. Leave unset unless the user asks to refresh or rerun.

Implementation Reference

  • The tool 'lookup_network' is registered in 'src/tools/geolocation.ts'. The handler executes 'getCachedOrFetchIpGeoBase' and then applies projection to return only the 'network' field.
        "lookup_network",
        {
          title: "Network/Routing Info",
          annotations: {
            readOnlyHint: true,
          },
          description: `Network lookup via GET /v3/ipgeo with network only. Paid only. Cost: 1 credit. Returns route prefix, connection type, and anycast status.
    
    Tool selection rule: use this tool for network-only requests. If the request also needs other IP domains, prefer one lookup_ip call with include plus targeted fields/excludes.`,
          inputSchema: {
            ip: z
              .string()
              .optional()
              .describe(
                "IPv4 or IPv6 address to look up. Omit to check the caller's IP."
              ),
            force_refresh: z
              .boolean()
              .optional()
              .describe("Default false. Leave unset unless the user asks to refresh or rerun."),
          },
        },
        async (params) => {
          try {
            const baseResult = await getCachedOrFetchIpGeoBase({
              ip: params.ip,
              forceRefresh: params.force_refresh,
            });
    
            const result = applyFieldsAndExcludes(baseResult, {
              fields: "network",
            });
    
            return {
              content: [
                { type: "text" as const, text: formatToolResult(result) },
              ],
            };
          } catch (error) {
            return errorToolResponse(error);
          }
        }
      );

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/IPGeolocation/ipgeolocation-io-mcp'

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