Skip to main content
Glama
haasonsaas

MCP Utility Tools

by haasonsaas

cache_delete

Remove specific data from cache storage to free up memory or update information. Specify a key to delete cached items.

Instructions

Delete a key from the cache

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesCache key to delete
namespaceNoOptional namespacedefault

Implementation Reference

  • Handler implementation for the cache_delete tool. Extracts key and optional namespace from arguments, constructs the full cache key using getCacheKey helper, deletes the entry from the cache Map if it exists, and returns a JSON response indicating success and whether the key existed.
    case "cache_delete": {
      const { key, namespace = "default" } = args as any;
      const cacheKey = getCacheKey(key, namespace);
      
      const existed = cache.delete(cacheKey);
      
      return {
        content: [{
          type: "text",
          text: JSON.stringify({
            success: true,
            key,
            namespace,
            existed
          })
        }]
      };
    }
  • Input schema definition for the cache_delete tool, specifying the required 'key' parameter and optional 'namespace'.
    {
      name: "cache_delete",
      description: "Delete a key from the cache",
      inputSchema: {
        type: "object",
        properties: {
          key: {
            type: "string",
            description: "Cache key to delete"
          },
          namespace: {
            type: "string",
            description: "Optional namespace",
            default: "default"
          }
        },
        required: ["key"]
      }
    },
  • Handler implementation for the cache_delete tool in the v1 index. Deletes the specified key from the cache and returns success status with existence info. No namespace support.
    case "cache_delete": {
      const { key } = args as { key: string };
      
      const existed = cache.delete(key);
      
      return {
        content: [{
          type: "text",
          text: JSON.stringify({
            success: true,
            key,
            existed
          })
        }]
      };
    }
  • Input schema for cache_delete in v1, requiring only the 'key' parameter (no namespace).
    {
      name: "cache_delete",
      description: "Delete a key from the cache",
      inputSchema: {
        type: "object",
        properties: {
          key: {
            type: "string",
            description: "Cache key to delete"
          }
        },
        required: ["key"]
      }
  • Helper function used by cache tools (including cache_delete) to generate namespaced cache keys.
    function getCacheKey(key: string, namespace: string = "default"): string {
      return `${namespace}:${key}`;
    }

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/haasonsaas/mcp-utility-tools'

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