Statistics Utilities

Calculate Product

Calculate Product multiplies an array of numbers together, returning the mathematical product. Access via MCP in Cursor or Windsurf, or call GET /v1/stats/product directly. For example, [2, 3, 5] returns 30. Handles floating-point precision correctly and returns 0 if any input is zero.

API Endpoint

GET /v1/stats/product

Code Examples

curl "https://tinyfn.io/v1/stats/product" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/stats/product', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/stats/product',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's statistics tools:

{
  "mcpServers": {
    "tinyfn-stats": {
      "url": "https://tinyfn.io/mcp/stats",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How do I calculate product of numbers using TinyFn?

Send a GET request to /v1/stats/product with your numbers array, or use the MCP tool in supported AI editors. Returns the mathematical product of all values.

What happens when calculating product with zero in the array?

The result is 0, following mathematical rules. Any number multiplied by zero equals zero, regardless of other values in the array.

Can I calculate product of decimal numbers with TinyFn?

Yes, it handles floating-point numbers correctly. For example, [2.5, 4, 1.2] returns 12.0 with proper precision handling.

How does TinyFn product calculation compare to spreadsheet PRODUCT function?

Identical behavior to Excel's PRODUCT() or Google Sheets' PRODUCT() functions. Same mathematical logic, but accessible via API or MCP for AI agents.

What's the advantage of using MCP for product calculations in AI workflows?

AI agents get deterministic results instead of potentially hallucinated math. Integrates directly into Cursor, Claude Code, and other MCP-supported editors.

Try Calculate Product Now

Get your free API key and start using Calculate Product in seconds.

Get Free API Key