Count Char tallies how many times a specific character appears in any string. Use it via MCP in Cursor or Windsurf, or call GET /v1/string/count-char with your text and target character. Perfect for data validation, parsing tasks, or analyzing text patterns. Returns an exact integer count, not an estimate.
curl "https://tinyfn.io/v1/string/count-char" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/string/count-char', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/string/count-char',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's string tools:
{
"mcpServers": {
"tinyfn-string": {
"url": "https://tinyfn.io/mcp/string",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Call the count_char tool with your string and the character to count. It returns the exact number of matches, case-sensitive by default.
Yes, it's case-sensitive. Counting 'A' in 'Apple' returns 1, not 2. You'll need to normalize case beforehand if needed.
Absolutely. Count spaces, emojis, accented characters, or any single Unicode character. It handles the full Unicode range.
GET /v1/string/count-char with parameters for the input string and target character. Returns JSON with the count value.
Agents can validate input formats (counting digits), parse structured data (counting delimiters), or analyze text patterns without hallucinating counts.