Performs text find-and-replace operations with exact string matching. Access via MCP in Cursor or Windsurf, or GET /v1/string/replace endpoint. Replace "old_text" with "new_text" in any input string — useful for cleaning data, transforming templates, or batch text processing in AI workflows.
curl "https://tinyfn.io/v1/string/replace" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/string/replace', {
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/replace',
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"
}
}
}
}
Make separate API calls for each replacement. The replace function handles one find-and-replace pair per request, but you can chain operations or use it iteratively in MCP workflows.
No, it performs exact string matching only. To replace 'cat' it won't match 'cats' — you need the exact substring.
Returns the original text unchanged. No error is thrown — it's a safe operation that won't break your AI agent workflows.
Replaces all occurrences by default. If 'hello' appears 3 times in your text, all 3 instances get replaced with your new string.
Call the replace tool with your source text, search string, and replacement. Useful for refactoring code snippets, cleaning CSV data, or transforming configuration templates.