Skip to main content
Glama
ImYourBoyRoy

web-scraper-server

by ImYourBoyRoy

truncate_text

Truncates text to fit within a token limit, preserving sentence boundaries. Ensures text meets model token constraints.

Instructions

Truncate text to fit within token limit. Preserves sentence boundaries when possible.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
modelNodefault
max_tokensNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses one behavioral trait ('Preserves sentence boundaries when possible'), but does not explain truncation behavior in edge cases (e.g., text shorter than limit, mid-sentence truncation when necessary, or how the 'model' parameter affects token counting). The disclosure is minimal but not absent.

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?

The description is extremely concise, consisting of two short sentences. It is front-loaded with the primary action and adds a single relevant detail, with no wasted words or repetition.

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?

The tool is simple, has an output schema, and the core purpose is clear. However, it lacks guidance on parameter interplay (model vs. max_tokens) and edge-case behavior, and does not address alternative tools. It is minimally complete but with notable gaps.

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. It only alludes to 'token limit' (likely max_tokens) and does not explain the 'text' or 'model' parameters meaningfully. It adds little beyond the raw schema, failing to clarify how model influences tokenization or what the default represents.

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 clearly states the tool's function: 'Truncate text to fit within token limit' with a specific verb and resource. It also provides a distinctive behavioral detail ('Preserves sentence boundaries when possible') that differentiates it from sibling tools like chunk_text or get_token_count.

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 usage context ('to fit within token limit') but does not explicitly state when to use this tool over alternatives such as chunk_text or when not to use it. No exclusions or alternative tool mentions are provided, leaving the guidance at an implied level.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ImYourBoyRoy/WebScraperToolkit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server