Skip to main content
Glama

cf_prune

Read-onlyIdempotent

Compresses long text for stable prompt prefixes by deduplicating lines, collapsing whitespace, and truncating to character or line limits, then reports size ratio and dropped line count.

Instructions

压缩你传入的文本,为稳定前缀腾出空间:去重行、压缩空白,按 maxChars / maxLines 双上限截断(默认保留头部),返回修剪前后体积比与丢弃行数。输入只认参数里的 text 字符串,输出是可直接拼进上下文的短文本;【何时调】工具输出很长、要压进上下文又不想破坏前缀稳定性时。要处理结构化行数据用 cf_normalize。白盒日志由服务端自维护(单文件 10MB 轮转、默认保留 7 天,DOBOCACHE_LOG_MAX_MB / DOBOCACHE_LOG_KEEP_DAYS 可调),体积无需人工干预。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>"
    },
    "name": "cf_prune"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYes原始工具输出
keepHeadNo保留头部(默认 true)
maxCharsNo最大字符数,默认 2000;必须为 ≥ 1 的整数
maxLinesNo最大行数,默认 200;必须为 ≥ 1 的整数

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.2

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, and the description adds real context beyond them: the exact transformation pipeline, the default truncation direction (head preserved), and the return payload. The trailing sentence about server-side log rotation and env vars is disclosed side-channel behavior but is not decision-relevant for calling this tool, keeping it just under a 5.

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

Conciseness3/5

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

The opening sentence is dense and front-loaded with the transformation and limits, and the bracketed when-to-call note is easy to scan. However, the final sentence about 10MB log rotation, 7-day retention and DOBOCACHE_* env vars is unrelated to selecting or invoking the tool and dilutes an otherwise tight definition.

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, but the description compensates by stating that the output is short text spliceable into context plus a before/after ratio and dropped-line count. Input constraints, defaults and the sibling alternative are all covered, leaving only minor gaps.

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 coverage is 100% and the schema already documents text, keepHead (default true), maxChars (default 2000, ≥1) and maxLines (default 200). The description restates the dual-cap truncation and head-keeping defaults, plus the constraint that only the text parameter supplies input, adding little 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 first sentence names a concrete verb (compress/prune) plus the exact operations performed: line dedupe, whitespace compression, and dual-cap truncation by maxChars/maxLines with head kept by default. It also distinguishes itself from cf_normalize and states what is returned (size ratio, dropped line count), so the agent knows exactly which tool this is.

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?

An explicit 【何时调】 block gives the trigger condition (tool output too long to fit in context while preserving prefix stability) and names the alternative cf_normalize for structured line data. Both when-to-use and when-to-use-something-else are stated outright.

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