Skip to main content
Glama

truncate

Truncate text to a length without splitting words, with an ellipsis. Pure CPU, instant.

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

Input Schema

NameRequiredDescriptionDefault
textYesText to truncate
lengthNoMax length

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Changed3 schema fields changed
    • addedInput schema / properties / length
      Added value: +{
      +  "description": "Max length",
      +  "type": "integer"
      +}
    • addedInput schema / properties / text
      Added value: +{
      +  "description": "Text to truncate",
      +  "type": "string"
      +}
    • addedInput schema / required
      Added value: +[
      +  "text"
      +]
  4. Added

TDQS

A3.5/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden; it does disclose two useful traits (word-boundary safety and ellipsis insertion) plus a performance note ('pure CPU, instant'). However, edge cases are unaddressed: whether the ellipsis counts toward the max length, and what happens when length is smaller than a single word.

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?

Two short sentences, zero filler, with the core behavior front-loaded and the operational trait ('pure CPU, instant') trailing as supplementary context. Nothing could be removed without losing information.

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?

For a two-parameter, synchronous, non-destructive utility with no output schema and full schema descriptions, the definition covers purpose, output shape (ellipsis) and cost. Only edge-case length semantics remain ambiguous, which is a minor gap at this complexity.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description genuinely adds meaning to 'length': it is an upper bound, output can be shorter because words are not split, and an ellipsis is appended. That shapes how an agent should set the value beyond the terse schema text.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

A specific verb (truncate) and resource (text) with two distinguishing behavior traits: no word splitting and an ellipsis appended. This separates it from word-level siblings like wrap_text or summarize. It stops short of naming any sibling explicitly, so a 4.

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

Usage Guidelines2/5

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

The description never says when to reach for this versus alternatives such as wrap_text, text_replace, or word_count, and gives no prerequisites or exclusions. Usage is only inferable from the verb itself, which is minimal guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources