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
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Cache key to delete | |
| namespace | No | Optional namespace | default |
Implementation Reference
- src/index-v2.ts:463-480 (handler)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 }) }] }; }
- src/index-v2.ts:144-162 (schema)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"] } },
- src/index.ts:324-339 (handler)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 }) }] }; }
- src/index.ts:122-134 (schema)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"] }
- src/index-v2.ts:274-276 (helper)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}`; }