caching_analytics
Analyze prompt-cache performance to measure hit rates, cache-read tokens, estimated USD savings, and per-agent cache-hit breakdown over a chosen time window.
Instructions
Prompt-cache insights (read from the tracing store): overall cache hit
rate, cache-read tokens, estimated USD saved, a cached-vs-uncached token
time series, and a per-agent cache-hit-rate breakdown. A focused slice of
the Live Monitor / /admin/live/analytics.json for "how much are we saving
from caching / which agents cache well". Cache-read is read from the
auto-instrumented gen_ai.usage.cache_read_input_tokens span attribute
(deduped to the LLM span); hit rate = cache_read / total input tokens.
hours is clamped to [1, 8760]; trace_env (dev|staging|prod|'') scopes to
traces tagged with that environment (environment is the deprecated alias);
env (staging|prod) selects the config branch used to price the savings
estimate.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "caching_analytics"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | Config branch: which `environment` rows of the AI config DB to read/write. staging = the editable working set (default); prod = what production serves. | staging |
| hours | No | Look-back window in hours (clamped to 1-8760). | |
| trace_env | No | Environment tag of the traces to scope telemetry to (dev|staging|prod); '' = all environments. | |
| agent_kind | No | Only this agent kind. | |
| environment | No | DEPRECATED alias of trace_env. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |