Invalidate Cache Entries
cache_invalidateDelete cached data matching a wildcard pattern to force fresh data retrieval or clear stale entries. Use targeted patterns for specific accounts or data types.
Instructions
✏️ Invalidate cache entries matching a pattern (requires user confirmation recommended)
Delete cache entries that match the specified pattern. This is useful for forcing fresh data retrieval or clearing stale cache entries.
Args: pattern: Pattern to match cache keys (supports wildcards): - "" matches any characters within a segment - Use "email_list:" to invalidate all email lists - Use "email_list:account@example.com:" for specific account - Use "folder_get_tree:" to invalidate all folder trees account_id: Optional account ID to scope invalidation (None = all accounts). reason: Reason for invalidation (for audit logging).
Returns: Dictionary containing: - entries_deleted: Number of cache entries deleted - pattern: Pattern that was used - account_id: Account ID filter (if specified) - reason: Invalidation reason - timestamp: When invalidation occurred
Examples: # Invalidate all email lists cache_invalidate("email_list:*", reason="email_sent")
# Invalidate specific account's folder tree
cache_invalidate(
"folder_get_tree:user@example.com:*",
account_id="user@example.com",
reason="folder_created"
)
# Invalidate all cache for an account
cache_invalidate("*:user@example.com:*", reason="account_refresh")Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | ||
| account_id | No | ||
| reason | No | manual_invalidation |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||