Math Utilities

Is Perfect Square

Determines whether a number is a perfect square (like 9, 16, 25) with mathematical precision. Use via MCP in Cursor or Windsurf for instant validation, or call GET /v1/math/is-perfect-square with your number. Returns boolean true/false plus the square root when applicable. Handles edge cases like negative numbers and decimals correctly.

API Endpoint

GET /v1/math/is-perfect-square

Code Examples

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

Call the is-perfect-square tool with your number. It returns a boolean result plus the square root if true.

What counts as a perfect square?

Positive integers whose square root is also an integer: 1, 4, 9, 16, 25, etc. Zero is considered a perfect square (0²=0).

Does the perfect square checker work with negative numbers?

No, negative numbers cannot be perfect squares since square roots of negatives aren't real numbers in standard math.

Can I check decimal numbers for perfect squares?

Yes, but they're rarely perfect squares. The tool handles decimals but will return false for most non-integer inputs.

What's the largest number I can test for perfect squares?

The tool handles very large integers efficiently, but extremely large numbers may hit practical limits depending on precision requirements.

Try Is Perfect Square Now

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

Get Free API Key