Finds the maximum value from a list of numbers with guaranteed accuracy. Access via MCP in Cursor, Windsurf, or other AI coding tools, or call GET /v1/misc/max directly. Pass an array like [3, 7, 1, 9, 2] and get back 9. Handles integers, floats, and mixed numeric types without floating-point precision issues.
curl "https://tinyfn.io/v1/misc/max" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/misc/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/misc/max',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's miscellaneous tools:
{
"mcpServers": {
"tinyfn-misc": {
"url": "https://tinyfn.io/mcp/misc",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Send a GET request to /v1/misc/max with your numeric array, or use the MCP tool in your AI coding environment. Returns the largest value with proper type preservation.
Yes, it handles all numeric types including negative integers, floating-point decimals, and mixed arrays. For example, [-5.5, -1, 0, 3.14] returns 3.14.
The function returns an appropriate error response when given an empty array, since there's no maximum value to calculate from zero elements.
Absolutely. AI agents can call this tool to find peaks in datasets, identify outliers, or perform statistical analysis without risking calculation errors from hallucinated results.
This provides deterministic results across different environments and handles large arrays without stack overflow issues that can occur with Math.max(...array) syntax.