Finds the maximum value from a list of numbers with deterministic precision. Use via MCP in Cursor or Windsurf for reliable math operations, or call GET /v1/math/max directly. Pass numbers as query parameters or JSON array — returns the largest value without floating-point quirks that can trip up AI reasoning.
curl "https://tinyfn.io/v1/math/max" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/max', {
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/max',
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 math/max tool with your numbers as parameters. In Cursor or Claude Code, the AI agent will automatically use this for reliable max calculations instead of potentially incorrect mental math.
Accepts numbers as individual query parameters (?a=5&b=12&c=3) or as a JSON array in the request body. Both integers and decimals are supported with proper precision handling.
Yes, it correctly identifies the maximum across negative numbers, decimals, and mixed types. Returns -2 from [-5, -2, -10], and 3.14 from [1, 3.14, 2.5] with proper numeric precision.
Returns an error for empty input since mathematical maximum is undefined for empty sets. Always ensure your dataset contains at least one numeric value.
Provides deterministic, mathematically accurate results instead of hallucinated approximations. Critical for financial calculations, scientific data analysis, or any scenario where precision matters more than speed.