Skip to main content
Glama

Invalidate Cache Entries

cache_invalidate
Idempotent

Delete 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

TableJSON Schema
NameRequiredDescriptionDefault
patternYes
account_idNo
reasonNomanual_invalidation

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description mentions deletion of cache entries, implying a destructive action, yet the destructiveHint annotation is false. This is a contradiction. Additionally, while it discloses the return values and pattern matching behavior, it does not discuss performance implications or authentication requirements beyond the optional account_id parameter. The annotation contradiction reduces transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with sections (Args, Returns, Examples) and front-loaded with a clear purpose. It is slightly verbose but every sentence adds value. The emoji provides instant recognition. Could be more concise, but overall efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the output schema exists and is referenced in the description, the description covers all aspects: what the tool does, parameters, return values, and examples. The tool has moderate complexity and the description is complete for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 0% schema description coverage, the description provides extensive details for each parameter: pattern supports wildcards with examples, account_id scoping, and reason default/audit logging. This fully compensates for the lacking schema descriptions and adds significant meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it invalidates cache entries matching a pattern. It uses specific verbs ('Invalidate', 'Delete') and specifies the resource ('cache entries'). It distinguishes from sibling cache tools like cache_get_stats and cache_warming_status by explicitly being the invalidation tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use it: for forcing fresh data retrieval or clearing stale cache entries. It includes examples for common use cases. Although it doesn't explicitly state when not to use it, the context of sibling tools and the note about user confirmation provide sufficient guidance. Lacks explicit exclusion of alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/robin-collins/m365-mcp'

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