Generates a random coin flip result returning either "heads" or "tails". Use via MCP in Claude or Cursor for quick randomization tasks, or call GET /v1/generate/coin directly. Perfect for adding true randomness to decision-making workflows, game mechanics, or A/B testing scenarios where you need unbiased binary outcomes.
curl "https://tinyfn.io/v1/generate/coin" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/generate/coin', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/generate/coin',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's generator tools:
{
"mcpServers": {
"tinyfn-generator": {
"url": "https://tinyfn.io/mcp/generator",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Returns a JSON response with the result as either "heads" or "tails". The randomization is cryptographically secure for fair outcomes.
No, each API call returns a single coin flip result. For multiple flips, make separate requests or use the result in a loop within your MCP-enabled editor.
Simply ask your AI assistant to "flip a coin" and it will use the MCP tool automatically. Great for breaking ties in code reviews or choosing between implementation approaches.
The flip uses cryptographically secure randomization, not deterministic algorithms. Each call produces genuinely unpredictable results suitable for fair decision-making.
No, this tool only provides standard 50/50 coin flips with "heads" or "tails" results. For weighted randomization, use other probability tools.