Math Utilities

Is Even

Returns true/false for whether a number is even using precise mathematical computation. Available via MCP in Cursor and other AI editors, or REST at GET /v1/math/is-even. Pass any integer and get deterministic boolean output — useful when AI agents need reliable parity checks instead of potentially incorrect calculations.

API Endpoint

GET /v1/math/is-even

Code Examples

curl "https://tinyfn.io/v1/math/is-even" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/is-even', {
  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-even',
    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 math tools:

{
  "mcpServers": {
    "tinyfn-math": {
      "url": "https://tinyfn.io/mcp/math",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How do I check if a number is even using TinyFn?

Send GET request to /v1/math/is-even with the number parameter, or use the MCP tool in Cursor/Claude Code. Returns boolean true for even numbers, false for odd.

What happens with negative numbers in is-even?

Works correctly with negative integers — returns true for -2, -4, etc. and false for -1, -3, etc. Uses standard mathematical definition of even/odd.

Can TinyFn is-even handle large integers?

Yes, handles arbitrarily large integers that fit within standard number representations. More reliable than AI hallucination for edge cases.

Why use an API for such a simple calculation?

Eliminates AI agent calculation errors and provides deterministic results. Particularly useful in MCP workflows where mathematical precision matters.

Does is-even work with decimal numbers?

Designed for integers. Behavior with decimals depends on implementation — typically rounds or returns error for non-whole numbers.

Try Is Even Now

Get your free API key and start using Is Even in seconds.

Get Free API Key