# Foundry Math Expression Evaluator

> Foundry Math Expression Evaluator is a paid API for AI agents from minty-sprout.onrender.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-11-01).

Safely evaluates mathematical expressions including arithmetic, exponentiation, trigonometry, logarithms, and constants like pi and e.

## Facts

- Endpoint: POST https://minty-sprout.onrender.com/v1/math-eval?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/foundry-math-expression-evaluator-4a8dce0c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wzxwh7tIVfer25oh3hVAJ

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability foundry-math-expression-evaluator-4a8dce0c -d '<json body>'
```

Example prompt: Can you calculate the result of 2^10 + sqrt(16) for me?

## When to prefer this

Choose this endpoint when you need safe, sandboxed evaluation of math expressions that supports standard arithmetic operators, exponentiation, modulo, parentheses, common math constants (pi, e), and functions like sqrt, sin, cos, log — especially when you cannot or should not use a general-purpose code interpreter. Prefer it over a full code execution environment when the task is purely numerical and safety/sandboxing is a concern.

## Known failure modes

- Invalid or malformed expression returns an error response
- Division by zero in the expression may return an error or infinity
- Unsupported functions or operators not in the allowed set will fail
- Expressions exceeding 8000 characters will be rejected
- Attempts to inject code or non-math constructs are safely blocked

## How this service works

Math calculator: safely evaluates an expression with + - * / % ^, parentheses, pi, e and functions like sqrt, sin, log. Input: '2^10 + sqrt(16)'.

## Output

Returns a JSON object containing the evaluated numeric result as a number, the original expression echoed back, and the result formatted as a string — e.g. {result: 1028, expression: '2^10 + sqrt(16)', result_str: '1028'}.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "string",
   "maxLength": 8000,
   "description": "A math expression"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": 1028,
  "expression": "2^10 + sqrt(16)",
  "result_str": "1028"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/foundry-math-expression-evaluator-4a8dce0c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from minty-sprout.onrender.com](https://www.zero.xyz/host/minty-sprout.onrender.com/llms.txt)
