Math Utilities

Maximum

Finds the maximum value from a list of numbers with deterministic precision. Use via MCP in Cursor or Windsurf for reliable math operations, or call GET /v1/math/max directly. Pass numbers as query parameters or JSON array — returns the largest value without floating-point quirks that can trip up AI reasoning.

API Endpoint

GET /v1/math/max

Code Examples

curl "https://tinyfn.io/v1/math/max" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/max', {
  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/max',
    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 find the maximum value from a list of numbers using MCP?

Call the math/max tool with your numbers as parameters. In Cursor or Claude Code, the AI agent will automatically use this for reliable max calculations instead of potentially incorrect mental math.

What formats does the maximum function accept?

Accepts numbers as individual query parameters (?a=5&b=12&c=3) or as a JSON array in the request body. Both integers and decimals are supported with proper precision handling.

Does math/max handle negative numbers and decimals correctly?

Yes, it correctly identifies the maximum across negative numbers, decimals, and mixed types. Returns -2 from [-5, -2, -10], and 3.14 from [1, 3.14, 2.5] with proper numeric precision.

What happens if I pass an empty list to the maximum function?

Returns an error for empty input since mathematical maximum is undefined for empty sets. Always ensure your dataset contains at least one numeric value.

How is this different from using AI to calculate maximum values?

Provides deterministic, mathematically accurate results instead of hallucinated approximations. Critical for financial calculations, scientific data analysis, or any scenario where precision matters more than speed.

Try Maximum Now

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

Get Free API Key