clearGeoCache
Clear cached geolocation data to ensure accurate location information and resolve outdated IP address mappings.
Instructions
Clear the geolocation cache
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/geo.ts:110-120 (handler)The handler function for the clearGeoCache tool. It clears the geoCache and returns a JSON confirmation message.handler: async () => { geoCache.clear(); return { content: [{ type: 'text', text: JSON.stringify({ message: 'Geolocation cache cleared' }, null, 2) }] }; }
- src/tools/geo.ts:106-109 (schema)The input schema for clearGeoCache, defining an empty object (no parameters required).inputSchema: { type: 'object', properties: {} },
- src/tools/geo.ts:103-121 (registration)The complete tool registration object for clearGeoCache, exported as part of geoTools and spread into allTools in index.ts.clearGeoCache: { name: 'clearGeoCache', description: 'Clear the geolocation cache', inputSchema: { type: 'object', properties: {} }, handler: async () => { geoCache.clear(); return { content: [{ type: 'text', text: JSON.stringify({ message: 'Geolocation cache cleared' }, null, 2) }] }; } }
- src/tools/geo.ts:4-4 (helper)The geoCache instance that is cleared by the clearGeoCache tool handler.const geoCache = new Cache<GeoLocation>(5 * 60 * 1000); // 5 minute cache
- src/index.ts:28-35 (registration)Spreading geoTools (which includes clearGeoCache) into the allTools object used for MCP tool listing and execution.const allTools: ToolKit = { ...systemTools, ...networkTools, ...geoTools, ...generatorTools, ...dateTimeTools, ...securityTools };