Skip to main content
Glama

Get Cache Statistics

cache_get_stats
Read-onlyIdempotent

Retrieve cache statistics and performance metrics including size, hit rates, entry counts, and compression details to monitor cache health.

Instructions

📖 Get cache statistics and performance metrics (read-only, safe for unsupervised use)

Retrieve comprehensive statistics about the cache system including size, hit rates, entry counts, and performance metrics.

Returns: Dictionary containing cache statistics: - total_entries: Total number of cached entries - total_bytes: Total size of cache in bytes - total_size_mb: Total size in megabytes - size_percentage: Percentage of max cache size used - total_hits: Number of cache hits - hit_rate: None until cache misses are tracked - entries_by_resource_type: Count of entries per resource type - average_entry_size_bytes: Average size per entry - compressed_entries: Number of compressed entries - compression_ratio: Average compression ratio - oldest_entry_age_hours: Age of oldest entry in hours - cleanup_triggered: Whether cleanup threshold has been reached - last_cleanup: Timestamp of last cleanup operation

Example: stats = cache_get_stats() print(f"Cache size: {stats['total_size_mb']:.2f} MB") print(f"Size used: {stats['size_percentage']:.1f}%")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Annotations already provide readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=true. The description adds value by detailing the exact statistics returned, such as hit rates and compression ratios, and reassures 'safe for unsupervised use'. No contradiction.

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 a header, safety note, bullet list of return fields, and an example. It is somewhat lengthy but every sentence adds value. Front-loading of key info is good.

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 zero parameters and a likely rich output schema, the description thoroughly explains the return fields and provides an example. It is fully self-contained for an agent to understand the tool's purpose and output.

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

Parameters4/5

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

There are zero parameters, so the description naturally has minimal param info. The schema coverage is 100% (none). The description provides an example usage, adding practical 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 the tool retrieves cache statistics and performance metrics, distinguishing it from sibling tools like 'cache_invalidate' and 'cache_warming_status'. It emphasizes 'read-only, safe for unsupervised use', which is a specific verb+resource combo.

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 explicitly marks the tool as safe and read-only, implying it's appropriate for any monitoring context. While it does not provide explicit exclusions or alternatives, the context is clear enough for an agent to decide when to use it.

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