Returns the smallest value from a list of numbers with guaranteed accuracy. Available via MCP in AI coding tools like Cursor and Windsurf, or REST API at `/v1/math/min`. Pass an array `[5, 2, 9, 1]` and get `1`. Handles integers, floats, and negative numbers without floating-point precision issues that plague native implementations.
curl "https://tinyfn.io/v1/math/min" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/min', {
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/min',
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 min tool with your number array. In Cursor or other MCP clients, it returns the exact smallest value without JavaScript's floating-point quirks.
The function returns an error since there's no minimum value in an empty set. Always validate your input arrays have at least one element.
Yes, it processes integers, floats, and negative numbers correctly. For example, `[-3.5, 2, -10, 0.1]` returns `-10`.
TinyFn provides deterministic results across different environments and avoids floating-point precision errors that can occur in native implementations.
Send a GET request to `/v1/math/min` with your numbers as query parameters or in the request body, depending on the API specification.