String Utilities

Repeat

Duplicates text strings a specified number of times with precise control. Access via MCP in Cursor or Windsurf, or call GET /v1/string/repeat with text and count parameters. Perfect for generating test data, creating separators, or building repeated patterns. Returns exact concatenation without separators unless specified.

API Endpoint

GET /v1/string/repeat

Code Examples

curl "https://tinyfn.io/v1/string/repeat" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/string/repeat', {
  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/repeat',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

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"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How do I repeat text multiple times with the repeat tool?

Send GET request to /v1/string/repeat with 'text' and 'count' parameters, or use the MCP tool in your AI editor. Returns the text concatenated the specified number of times.

Can I add separators between repeated text instances?

Yes, most implementations allow a separator parameter. Without it, text concatenates directly (e.g., 'hi' × 3 = 'hihihi').

What happens if I specify zero or negative repeat counts?

Zero returns an empty string. Negative values typically return empty string or error, depending on implementation validation.

How does MCP text repeat compare to using loops in code?

MCP gives AI agents deterministic string repetition without generating code. Faster for simple cases, while loops offer more complex pattern control.

What's the maximum number of repetitions allowed?

Limits vary by implementation to prevent memory issues. Typically several thousand repetitions for reasonable text lengths are supported.

Try Repeat Now

Get your free API key and start using Repeat in seconds.

Get Free API Key