Cuts text to a specified maximum length with optional ellipsis handling. Use via MCP in Cursor or Windsurf, or call GET /v1/format/truncate with text and length parameters. Perfect for preview snippets, UI constraints, or data processing where content needs consistent sizing. Returns deterministic results unlike AI-generated summaries.
curl "https://tinyfn.io/v1/format/truncate" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/format/truncate', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/format/truncate',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's formatting tools:
{
"mcpServers": {
"tinyfn-format": {
"url": "https://tinyfn.io/mcp/format",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Pass your text and max_length=100 parameters. The tool will cut at exactly 100 characters and can optionally append '...' if the original text was longer.
The basic truncation cuts at the exact character limit. For word-boundary preservation, you'd need to post-process or use a different approach depending on your specific requirements.
Yes, MCP integration lets you truncate multiple strings programmatically in AI workflows. Useful for standardizing data lengths before further processing or display.
The text returns unchanged. No padding or modification occurs when content is already within the specified limit.
It counts by Unicode code points, so multi-byte characters like emojis count as single characters. This ensures consistent behavior across different character sets.
Get your free API key and start using Format Truncate in seconds.
Get Free API Key