Square multiplies any number by itself, returning the mathematical square via GET /v1/math/square. Perfect for AI agents calculating areas, statistical variance, or quadratic operations in Cursor and Claude Code. Handles integers, decimals, and negative numbers with full precision.
curl "https://tinyfn.io/v1/math/square" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/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/square',
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"
}
}
}
}
Call the square tool with your number as input. It works with any numeric value including decimals and negatives, returning the precise mathematical result.
Square specifically multiplies a number by itself (n²), while power functions handle any exponent. Square is optimized for this common operation.
Yes, it follows standard mathematical rules: negative numbers squared become positive (e.g., (-5)² = 25).
Accepts integers, decimals, scientific notation, and negative numbers. Returns results with appropriate precision for the input type.
Absolutely. It's commonly used for area calculations, statistical operations, and any scenario requiring deterministic n² computation.