Skip to main content
Glama

cf_normalize

Read-onlyIdempotent

Normalizes structured row arrays by applying a field whitelist and stable sort, so identical data with jittered order produces the same cache key and an nk- fingerprint.

Instructions

归一化结构化行数据(对象数组):按字段白名单裁剪 + 稳定排序,让内容相同但顺序抖动的返回归为同一个缓存键,输出归一后的 rows 与 nk- 前缀键指纹。与 cf_prune 的分工:cf_normalize 吃 rows 数组、产出稳定键;cf_prune 吃纯文本、产出短文本。【何时调】同类工具多次返回、内容相同但字段顺序抖动导致缓存键反复失效时调一次,把顺序固定下来。

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": {
      "rows": "<rows>"
    },
    "name": "cf_normalize"
  }
}

Input Schema

NameRequiredDescriptionDefault
rowsYes结构化行数据(对象数组),排序依据字段名而非原始行序
fieldsNo保留字段白名单;不传则保留全部字段

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.6.0
    • changedInput schema / properties / fields / description
      Previous value: -"保留字段白名单"New value: +"保留字段白名单;不传则保留全部字段"
    • changedInput schema / properties / rows / description
      Previous value: -"结构化行数据"New value: +"结构化行数据(对象数组),排序依据字段名而非原始行序"
  2. First observedv0.5.2

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent and non-destructive, so the safety profile is covered. The description goes beyond them by disclosing the return shape (normalized rows plus an `nk-` prefixed key fingerprint) and the behavioral contract that ordering derives from field names rather than original row order — information no annotation conveys. It does not discuss failure modes, but for a pure normalization function that is a minor gap.

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?

Content is front-loaded: what it does, then the sibling split, then the trigger, in clearly separated clauses. The labeling (与 cf_prune 的分工 / 【何时调】) aids scanning, though the phrasing is somewhat dense and the sibling division-of-labor sentence partly overlaps with the trigger sentence.

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?

With only two parameters and no output schema, the description carries the necessary weight by explaining the output (normalized rows and the `nk-` fingerprint) that structured fields cannot convey. Nothing an agent needs in order to call this correctly appears to be missing.

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 both parameters (rows, fields) are already documented, including the note that omitting fields keeps everything. The description restates the whitelist trimming and stable sorting at the same level of detail as the schema rather than adding syntax or format guidance, so the baseline 3 applies.

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?

States a specific verb and resource (归一化结构化行数据/对象数组) plus the two operations it performs (白名单裁剪 + 稳定排序) and the goal (统一缓存键). It explicitly demarcates itself from cf_prune by input type and output type, so an agent can choose between them 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?

The 【何时调】 block gives a concrete trigger: repeated identical-content returns whose field order jitters and invalidates the cache key. It also names the alternative (cf_prune) and the condition that selects it (plain text input, short-text output), leaving nothing to inference.

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