Validates whether a given number is an integer with perfect accuracy. Use via MCP in Cursor or Windsurf, or call GET /v1/math/is-integer directly. Returns true for whole numbers like 42 or -7, false for decimals like 3.14. Essential for data validation in AI agents handling numeric input.
curl "https://tinyfn.io/v1/math/is-integer" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/is-integer', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/math/is-integer',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's math tools:
{
"mcpServers": {
"tinyfn-math": {
"url": "https://tinyfn.io/mcp/math",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Returns false for NaN, positive infinity, and negative infinity since these are not valid integers.
Yes, 5.0 is mathematically an integer despite decimal notation. The tool checks mathematical properties, not string format.
Absolutely. Claude Code and other MCP clients can validate user input before processing, preventing errors in calculations.
TinyFn's implementation handles edge cases like infinity and NaN correctly, while modulo checks can produce unexpected results.
Yes, it correctly identifies integers within JavaScript's safe integer range and handles precision issues automatically.