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
| Name | Required | Description | Default |
|---|---|---|---|
| ip | No | IPv4 or IPv6 address to look up. Omit to check the caller's IP. | |
| force_refresh | No | Default false. Leave unset unless the user asks to refresh or rerun. |
Implementation Reference
- src/tools/geolocation.ts:476-495 (handler)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); } } - src/tools/geolocation.ts:453-475 (registration)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."), }, },