Skip to main content
Glama

cf_report

Aggregates request counts, vendor usage cache-hit rates, token totals, and hit ratios from local logs to report cumulative cache effectiveness across processes and days.

Instructions

历史报表:从本地白盒日志汇总请求次数、厂商 usage 真实缓存命中率、原始/优化 token、预计命中 token 与命中比例,【何时调】任务收尾、或用户问「缓存效果怎么样/命中多少」时调一次即可(读落盘日志,跨进程跨天累计,重启不丢);不要每轮轮询。支持 total / per_session 聚合,附带 cardMode(白盒卡片档位,默认 quiet)。与 cf_meter 的分工:cf_report 读落盘日志,可跨进程、跨天累计(source=disk,进程重启不丢);cf_meter 只报当前进程内即时快照。命中率为 null 表示本期没有可判定的厂商 usage 数据(未判定),不是 0%。日志默认写平台标准可写目录(DOBOCACHE_LOG_DIR 可覆盖),只在本机、不含提问原文、不占对话 token;按「单文件 10MB 轮转 + 默认保留 7 天」自动维护(DOBOCACHE_LOG_MAX_MB / DOBOCACHE_LOG_KEEP_DAYS 可调),返回中的 logPolicy 即当前生效值。

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": "cf_report"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNosource=disk 时回溯的自然日数(v0.4.7,默认等于日志保留天数,通常 7 天)
resetNo是否清空累计计数后输出空统计
sourceNo统计来源(v0.4.7,默认 memory):memory=当前进程内累计,进程重启即从 0 开始;disk=读取本地白盒日志重新聚合,跨进程/跨天累计,适合回答「累计到底省了多少」。disk 为纯本地只读,不联网、不上报。
aggregateByNo聚合维度(v0.4.2,默认 total):total=进程内累计;per_session=按会话分组)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.2

TDQS

A4.3/5.0
Behavior4/5

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

Beyond the sparse annotations it discloses a lot: logs are on-disk and survive restarts, they are local-only, contain no prompt text and consume no conversation tokens, retention is 10MB-rotation plus 7 days with env-var overrides, and logPolicy in the response reports the effective policy. It also explains that a null hit rate means "not determinable this period", not 0%. The one gap: the `reset` capability that clears accumulated counters is only described in the schema, and the annotations' readOnlyHint=false/destructiveHint=false pair is never reconciled in prose.

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?

Usage guidance and the cf_meter split are front-loaded where an agent will read them, and the operational details (retention, env vars, null semantics) are genuinely useful. It is still a dense single paragraph with heavy parentheticals, and the stray `cardMode` mention is a sentence that does not earn its place.

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

Completeness4/5

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

There is no output schema, and the description compensates by naming key return concepts (hit ratio, logPolicy, null-as-undetermined) plus data provenance and retention. What remains thin is the response shape itself and the effect of `reset`, but the reader has enough to call the tool correctly.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already carries days/source/aggregateBy/reset semantics; the description only restates the total/per_session aggregation and the disk-vs-memory distinction. It also advertises a `cardMode` option (default quiet) that does not exist among the four schema properties, which adds noise rather than meaning for the actual parameter set.

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?

First clause names a specific verb and resource set: aggregating from local white-box logs the request count, vendor-usage real cache hit rate, raw/optimized tokens, expected-hit tokens and hit ratio. It explicitly distinguishes itself from cf_meter by data source (disk vs in-process snapshot), so an agent can tell the two apart without opening either schema.

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

Usage Guidelines5/5

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

It gives an explicit when-to-call (task wrap-up, or when the user asks how caching performed / how many hits), an explicit when-not-to-call ("不要每轮轮询" – don't poll every turn, call once), and names the alternative tool plus the exact condition that selects it (cf_report for cross-process/cross-day accumulation, cf_meter for an in-process snapshot).

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