truncate_context
Trim text to token budget (head+tail).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| max_tokens | No | ||
| keep_head_ratio | No | ||
| preserve_numbers | No |
Trim text to token budget (head+tail).
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| max_tokens | No | ||
| keep_head_ratio | No | ||
| preserve_numbers | No |
Changes observed during successful MCP inspections.
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden of behavioral disclosure. It reveals the head+tail truncation strategy, which is useful, but omits details about token counting, handling of short texts, or effects on numbers. It provides some transparency but not comprehensive behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no wasted words. It clearly states the action and the key characteristic (head+tail), making it highly concise and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has four parameters, no output schema, and no annotations. The description is too minimal to cover return values, edge cases, or usage nuances. It leaves significant gaps for an agent to safely invoke the tool, especially regarding parameter behavior and expected output.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description only vaguely touches on 'token budget' and 'head+tail'. It fails to explain parameters like max_tokens, keep_head_ratio, and preserve_numbers, leaving the agent to infer their semantics from names and defaults. The description adds minimal value beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'Trim' with a clear resource 'text to token budget (head+tail)', which precisely conveys the tool's function. It distinguishes itself from siblings like chunk_text and summarize_text by clearly indicating a truncation operation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the usage context: when text needs to be reduced to a token budget. However, it does not explicitly compare against alternatives like chunk_text or summarize_text, nor does it provide exclusions or prerequisites, so guidance is only implied rather than fully articulated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Add one secure layer between your agents and this server.