perplexity_cache_clear
Clear cached responses to ensure fresh API calls and updated information from the Perplexity AI integration.
Instructions
Clear the response cache to force fresh API calls
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:751-758 (handler)Handler case for 'perplexity_cache_clear' tool that invokes clearCache method and formats the response as text content.case "perplexity_cache_clear": const clearResult = nascoderMCP.clearCache(); return { content: [{ type: "text", text: clearResult.message }] };
- index.js:683-691 (registration)Registration of 'perplexity_cache_clear' tool in the TOOLS array, including empty input schema.{ name: "perplexity_cache_clear", description: "Clear the response cache to force fresh API calls", inputSchema: { type: "object", properties: {}, required: [] } },
- index.js:575-589 (helper)The clearCache helper method in NascoderPerplexityMCP class that flushes the NodeCache and handles errors, returning success/error message.// Clear cache with error handling clearCache() { try { if (this.cache) { this.cache.flushAll(); this.logger.info('Cache cleared successfully'); return { success: true, message: 'Cache cleared successfully' }; } else { return { success: true, message: 'No cache to clear (cache disabled)' }; } } catch (error) { this.logger.error('Failed to clear cache:', error.message); return { success: false, message: `Failed to clear cache: ${error.message}` }; } }