Math Utilities

Is Positive

Validates whether a number is positive (greater than zero) with deterministic boolean output. Available through GET /v1/math/is-positive or as an MCP tool in Cursor and Claude Code. Returns true for 5.7, false for -3 and 0. Essential for data validation pipelines where AI agents need reliable numeric classification without computational errors.

API Endpoint

GET /v1/math/is-positive

Code Examples

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

What counts as a positive number in this validation?

Only numbers greater than zero return true. Zero and negative numbers return false.

How do I use is-positive with MCP in Cursor?

Call the is-positive tool directly in your MCP-enabled environment. The AI agent will get a deterministic boolean response instead of potentially incorrect calculations.

Does is-positive handle decimal numbers and scientific notation?

Yes, it correctly processes decimals like 3.14159 and scientific notation like 1.5e-10, returning true for any value > 0.

What's the difference between is-positive and just checking num > 0?

This tool provides guaranteed accuracy for edge cases, handles various number formats consistently, and gives AI agents reliable results without floating-point comparison issues.

Can I batch check multiple numbers for positivity?

This tool validates one number per request. For bulk validation, make separate API calls or use it iteratively within your MCP workflow.

Try Is Positive Now

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

Get Free API Key