Skip to main content
Glama

truncate_persian_text

Shorten Persian text to a maximum length while preserving words, ZWNJ-joined terms, surrogate pairs, and diacritics, with optional word or character mode and custom ellipsis.

Instructions

Truncate text to maxLength (ellipsis included) without breaking words, ZWNJ-joined words, surrogate pairs or diacritics. mode 'word' (default) or 'char'.

Input Schema

NameRequiredDescriptionDefault
modeNo
textYes
ellipsisNo
maxLengthYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

B3.2/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does well: it discloses that the ellipsis counts toward maxLength, that word boundaries, ZWNJ sequences, surrogate pairs and diacritics are never split, and that the default mode is 'word'. It omits any statement about the return value or behavior when the text is already shorter than maxLength.

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?

Two compact sentences with no filler, and the preservation guarantees plus the mode default are front-loaded. Density is high, though the parenthetical and the trailing mode clause make the second half slightly list-like rather than immediately scannable.

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

Completeness3/5

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

For a no-annotation, no-output-schema, 0%-coverage four-parameter tool, the description covers the core contract but leaves the ellipsis parameter undefined and never states the return type. It is adequate to call the tool in the common case but not complete for all parameters.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for four undocumented parameters. It explains maxLength's ellipsis-inclusive semantics and the mode enum default, but says nothing about the 'ellipsis' parameter (a custom string up to 10 chars) or what 'text' accepts, leaving half the surface ambiguous.

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?

States a specific verb and resource ('truncate text to maxLength') and even names the special cases it preserves (ZWNJ-joined words, surrogate pairs, diacritics), which quickly signals a Persian-aware utility. It does not, however, differentiate itself from adjacent text-manipulation siblings like sanitize_persian_text or normalize_persian_text.

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 only usage-like information is that 'word' is the default mode and 'char' is the alternative, which is parameter guidance rather than when-to-use guidance. There is no statement of when truncation is appropriate versus normalizing or sanitizing, and no exclusions or prerequisites.

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