Math Utilities

Add

Performs precise addition of two or more numbers with deterministic results. Use via MCP in Cursor, Windsurf, or other AI coding tools, or call GET /v1/math/add directly. Example: adding 15.7 + 23.2 + 8.1 returns exactly 47.0. Handles integers, decimals, and scientific notation without floating-point precision issues.

API Endpoint

GET /v1/math/add

Code Examples

curl "https://tinyfn.io/v1/math/add" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/add', {
  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/add',
    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 math tools:

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

Learn more about MCP setup →

FAQ

How do I add multiple numbers using the TinyFn add tool?

Pass numbers as query parameters or in the request body. The tool accepts any quantity of numbers and returns their exact sum.

Does TinyFn addition handle floating-point precision issues?

Yes, it provides deterministic results without typical JavaScript floating-point errors like 0.1 + 0.2 = 0.30000000000000004.

Can I use the add tool with MCP in AI coding assistants?

Absolutely. AI agents in Cursor, Claude Code, Windsurf, and others can call this tool for reliable arithmetic instead of potentially incorrect calculations.

What number formats does the TinyFn add endpoint support?

It handles integers, decimals, negative numbers, and scientific notation (like 1.5e10) with consistent precision.

Is there a limit to how many numbers I can add together?

The tool can add numerous values in a single operation, though practical limits depend on URL length for GET requests.

Try Add Now

Get your free API key and start using Add in seconds.

Get Free API Key