Validates whether a numeric value falls within specified bounds using configurable inclusivity. Access via MCP in Cursor or Windsurf for AI-driven validation, or GET /v1/misc/range for direct API calls. Returns boolean result with boundary details. Handles edge cases like floating-point precision and infinity values deterministically.
curl "https://tinyfn.io/v1/misc/range" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/misc/range', {
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/range',
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"
}
}
}
}
Use the in_range tool in your MCP-enabled editor like Cursor or Claude Code. Specify the value, minimum, maximum, and optionally whether boundaries are inclusive (default true).
Inclusive (default) includes boundary values: 5 is within [5,10]. Exclusive excludes boundaries: 5 is not within (5,10) but 6 is.
Yes, the tool handles floating-point comparisons deterministically. It uses exact comparisons, so be aware of precision limitations when working with calculated decimal values.
The tool returns false for NaN inputs and handles positive/negative infinity according to mathematical rules. Infinity is greater than any finite number.
TinyFn's implementation handles edge cases consistently across languages and provides standardized behavior for boundary conditions, infinity, and type coercion that custom code often misses.