Skip to main content
Glama

truncate_text_token_budget

Truncates text to an exact token budget while preserving unicode emojis, code blocks, and markdown syntax. Use it when output must fit strict token limits without breaking content structure.

Instructions

Clamps text to exact token budgets without splitting unicode emojis, code blocks, or markdown syntax. (0.005 USDC on Base L2)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
payloadYesInput parameters or JSON string payload for the tool execution
paymentSignatureNoBase L2 USDC micropayment signature or transaction hash for x402 settlement

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the transparency burden. It discloses useful behaviors: exact clamping, no splitting of emojis/code blocks/markdown, and the 0.005 USDC cost on Base L2. However, it does not explain what the tool returns, how clamping handles over-limit input, or whether it errors versus truncating silently.

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

Conciseness5/5

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

One compact sentence delivers the core behavior, the key preservation guarantees, and the pricing detail. No filler, immediately scannable, and effectively front-loaded.

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

Completeness2/5

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

The tool uses a generic payload schema and has no output schema, so the agent must infer how to pass the text and token budget. The description confirms what the tool does but does not specify the expected payload format or return shape, leaving the invocation contract ambiguous.

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 baseline is 3. The description adds no field-level meaning beyond the schema, particularly for how to specify the target token budget or the input text inside the generic 'payload' string.

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 description uses a specific verb ('Clamps'), a clear resource ('text'), and a precise target ('exact token budgets'). It also distinguishes the tool by naming preservation constraints (unicode emojis, code blocks, markdown syntax), making its purpose unmistakable.

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

Usage Guidelines3/5

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

The description implies the use case: fitting text into a strict token budget while preserving markdown structure. However, it gives no explicit guidance about when to choose this tool over alternatives like chunk_text_semantic or clean_markdown_for_llm, and it names no alternative tools.

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

Deploy Server

Other Tools