Returns all positive divisors of a given integer in ascending order. Access via MCP in Cursor or Windsurf, or REST at `/v1/number/divisors`. For example, divisors of 12 are [1, 2, 3, 4, 6, 12]. Essential for mathematical computations where AI agents need exact factor lists instead of approximations.
curl "https://tinyfn.io/v1/number/divisors" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/number/divisors', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/number/divisors',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's number tools:
{
"mcpServers": {
"tinyfn-number": {
"url": "https://tinyfn.io/mcp/number",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Divisors are positive integers that divide evenly into a number. This tool returns all divisors in ascending order, from 1 to the number itself.
Use the get_divisors tool with the number parameter. It returns an array of all positive divisors sorted ascending.
Mathematically identical - both refer to numbers that divide evenly. This tool returns positive divisors only, excluding negative factors.
Works with standard integers, but computation time increases with larger numbers since it must check all potential divisors up to the square root.
Returns JSON with a sorted array of integers. For divisors of 20: [1, 2, 4, 5, 10, 20].
Get your free API key and start using Get Divisors in seconds.
Get Free API Key