Skip to main content
Glama

rag_cache_clear

Clear the LAZY-RAG cache to remove outdated or incorrect data and start fresh for accurate information retrieval.

Instructions

Clear the LAZY-RAG cache to start fresh

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The implementation of the `handleRagCacheClear` handler function in `src/handlers/tools.ts`, which calls `getRAGIntegrator().clearCache()` and returns the operation result.
      private async handleRagCacheClear(_args: any): Promise<CallToolResult> {
        try {
          const rag = getRAGIntegrator();
          const result = rag.clearCache();
    
          return {
            content: [{
              type: 'text',
              text: `🧹 LAZY-RAG Cache Cleared
    
    ✅ Cleared ${result.previousSize} cached entries
    💡 Next queries will call the API and repopulate the cache`
            }]
          };
        } catch (error: unknown) {
          const errorMessage = error instanceof Error ? error.message : 'Unknown error';
          return {
            content: [{
              type: 'text',
              text: `❌ Failed to clear cache: ${errorMessage}`
            }],
            isError: true
          };
        }
      }

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/Wolfe-Jam/grok-faf-mcp'

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