Calculates the nth cube number (n³) for any positive integer. Use via MCP in AI coding assistants or REST API at `/v1/number/cube`. For example, the 5th cube number is 125 (5³). Perfect for mathematical computations, sequence generation, and volume calculations where you need precise cubic values without manual computation.
curl "https://tinyfn.io/v1/number/cube" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/number/cube', {
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/cube',
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"
}
}
}
}
Pass n=10 to get 1000 (10³). The tool returns the exact cubic value for any positive integer input.
Nth cube calculates n³ (5 becomes 125), while cube root finds what number cubed gives you the input (125 becomes 5).
Yes, MCP integration lets AI agents call this tool directly to generate cube sequences, verify cubic calculations, or solve math problems requiring precise cube values.
The tool accepts any integer. 0³ returns 0, and negative numbers work correctly ((-3)³ = -27).
Limited by standard integer precision, typically up to very large values before overflow. For most practical applications, it handles any reasonable input size.