"How many R's in strawberry?" This question became a meme because LLMs consistently get it wrong. String counting, pattern extraction, and text manipulation seem trivial — but LLMs process tokens, not characters. These tools give your agent precise string operations.
All String Tools (33)
Your agent gets access to 33 string tools via the /mcp/string/ endpoint. Here's the complete list:
| Tool | Description |
|---|---|
string/reverse | Reverse String |
string/uppercase | Uppercase |
string/lowercase | Lowercase |
string/capitalize | Capitalize |
string/title-case | Title Case |
string/sentence-case | Sentence Case |
string/camel-case | Camel Case |
string/snake-case | Snake Case |
string/kebab-case | Kebab Case |
string/pascal-case | Pascal Case |
string/length | String Length |
string/word-count | Word Count |
string/trim | Trim |
string/truncate | Truncate |
string/pad | Pad |
string/repeat | Repeat |
string/replace | Replace |
string/contains | Contains |
string/starts-with | Starts With |
string/ends-with | Ends With |
string/split | Split |
string/join | Join |
string/slug | Slug |
string/is-palindrome | Is Palindrome |
string/count-char | Count Char |
string/count-substring | Count Substring |
string/count-all-chars | Count All Chars |
string/remove-whitespace | Remove Whitespace |
string/normalize-whitespace | Normalize Whitespace |
string/is-empty | Is Empty |
string/extract-numbers | Extract Numbers |
string/extract-emails | Extract Emails |
string/extract-urls | Extract Urls |
Agent Scenarios
Here's how real agents use these tools:
1. Content moderation agent
A moderation agent needs to check if user input exceeds character limits. string/length returns the exact count, not an LLM guess.
string/length
{ "text": "Check this message length" }
2. SEO optimization agent
An SEO agent truncates meta descriptions to 160 characters without breaking words. string/truncate handles this cleanly.
string/truncate
{ "text": "Your long description...", "length": 160 }
3. Data cleaning pipeline
An ETL agent needs to pad order IDs to 8 characters with leading zeros. string/pad produces consistent results.
string/pad-start
{ "text": "1234", "length": 8, "char": "0" }
MCP Setup
Add string tools to your agent in under 2 minutes. Choose your client:
Claude Desktop / Claude Code
Add this to your MCP config:
{
"mcpServers": {
"tinyfn-string": {
"url": "https://api.tinyfn.io/mcp/string/",
"headers": {
"X-API-Key": "your-api-key"
}
}
}
}
Cursor
Go to Settings > MCP and add a new server:
- Type: SSE
- URL:
https://api.tinyfn.io/mcp/string/sse - Headers:
X-API-Key: your-api-key
Tip: Use the category-specific endpoint (/mcp/string/) for the best experience. The all-in-one endpoint (/mcp/all/) works too but has 500+ tools which some clients handle less efficiently.
When to Use These Tools
Use string MCP tools when your agent needs to:
- Guarantee correctness — when wrong answers have real consequences
- Process user data — when you're operating on actual user input, not hypothetical examples
- Maintain consistency — when the same input must always produce the same output
You don't need these tools for casual conversation or rough estimates. Use them when precision matters.
Ready to add string tools to your agent?
Get Free API Key 100 requests/month free. No credit card required.Frequently Asked Questions
Why can't LLMs count characters accurately?
LLMs process text as tokens (chunks of characters), not individual characters. When asked to count specific characters, they must reason about tokenized representations, which leads to frequent errors — especially with repeated characters.
What string operations does TinyFn provide?
TinyFn offers 30+ string tools: length, reverse, truncate, pad, repeat, count characters, extract substrings, split, join, replace, and more.
Can these tools handle Unicode text?
Yes. All TinyFn string tools handle Unicode correctly, including emoji, CJK characters, and multi-byte sequences.