Validates whether a number is perfect — where the sum of its proper divisors equals the original number. Use via MCP in Cursor or Windsurf, or call GET /v1/number/is-perfect with your number. Returns true for classics like 6 (1+2+3=6) and 28. Perfect numbers are rare mathematical gems that AI agents can now identify deterministically.
curl "https://tinyfn.io/v1/number/is-perfect" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/number/is-perfect', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/number/is-perfect',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's number tools:
{
"mcpServers": {
"tinyfn-number": {
"url": "https://tinyfn.io/mcp/number",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
A perfect number equals the sum of its proper divisors (excluding itself). For example, 6 = 1+2+3. The tool calculates all divisors and checks if they sum to the original number.
In Cursor, Claude Code, or Windsurf, the AI agent can call this tool directly when you ask about perfect numbers. It returns a boolean result plus the divisor breakdown for verification.
Try 6, 28, 496, and 8128 — these return true. Most numbers like 12 or 100 return false since their proper divisors don't sum to the original value.
The tool handles reasonable integer ranges efficiently. Very large numbers may timeout due to divisor calculation complexity, but it works fine for typical mathematical exploration.
This provides instant, deterministic validation without manual calculation errors. Perfect for mathematical verification, educational tools, or when AI agents need reliable number theory results.
Get your free API key and start using Is Perfect Number in seconds.
Get Free API Key