Skip to main content
Glama
IPGeolocation

IP Geolocation MCP Server

lookup_currency

Retrieve currency and country metadata for IP addresses to support financial calculations and location-based services.

Instructions

Currency and country metadata lookup via GET /v3/ipgeo with currency and country_metadata only. Works on free and paid plans. Cost: 1 credit.

Tool selection rule: use this tool for currency-only or country-metadata-only requests. If the request needs more IP data, prefer one lookup_ip call with 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 implementation of the `lookup_currency` tool, which fetches IP geolocation data and filters for currency and country metadata.
    async (params) => {
      try {
        const baseResult = await getCachedOrFetchIpGeoBase({
          ip: params.ip,
          forceRefresh: params.force_refresh,
        });
    
        const result = applyFieldsAndExcludes(baseResult, {
          fields: "currency,country_metadata",
        });
    
        return {
          content: [
            { type: "text" as const, text: formatToolResult(result) },
          ],
        };
      } catch (error) {
        return errorToolResponse(error);
      }
    }
  • Registration of the `lookup_currency` tool with its schema and metadata.
      server.registerTool(
        "lookup_currency",
        {
          title: "Currency and Country Metadata",
          annotations: {
            readOnlyHint: true,
          },
          description: `Currency and country metadata lookup via GET /v3/ipgeo with currency and country_metadata only. Works on free and paid plans. Cost: 1 credit.
    
    Tool selection rule: use this tool for currency-only or country-metadata-only requests. If the request needs more IP data, prefer one lookup_ip call with 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."),
          },
        },

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