Back to all tools
Free / no key

Math calculator

Use this when customers ask for calculations (totals, percentages, simple formulas). The agent sends the expression to the public mathjs API and returns the result.

What this tool does

Language models are good at conversation but can slip on arithmetic, especially with percentages, discounts and multi-item totals. This tool hands the calculation to the mathjs API, which returns an exact result that your agent then puts into a friendly reply. Your agent decides when to use it: whenever a customer asks for a total, a split, a discount or a monthly cost, it builds the expression, sends it and quotes the answer. Nothing is stored and no key is needed.

Example conversation

Customer

If I book 3 sessions at $85 and use the 15% returning client discount, what do I pay?

Tool callevaluate_math

expression: 3 * 85 * (1 - 0.15)

AI agent

Let me work that out. 3 × $85 is $255, and 15% off brings it to $216.75.

Customer

And if I split it over 3 months?

AI agent

That would be $72.25 a month. Would you like me to book the first session?

Example only. Tool calls are shown so you can see when the agent uses this template. Your agent’s wording depends on your prompt and business information.

Who uses it

  • Clinics and salons quoting package prices with a discount or deposit applied.
  • Home service businesses adding up materials, labour and call-out fees for a rough quote.
  • Tutors and coaches working out monthly costs for a set number of lessons.

Setup

  1. Open Create agent or Edit agent and add a custom tool.
  2. Copy the fields below into the form. No API key is required.
  3. Optionally mention evaluate_math in your prompt when the customer needs a calculation.

Copy into custom tool form

Copy each value into the matching field when you add a custom tool on the create or edit agent page. Replace any YOUR_… placeholders with your real credentials.

Tool name

evaluate_math

Description

Evaluate a math expression when the customer asks for a calculation. Use this for arithmetic, percentages, unit-style expressions supported by mathjs.

Endpoint URL

Paste into Endpoint URL (https:// is added automatically).

api.mathjs.org/v4/

HTTP method

GET

Tool inputs (all)

1. expression (string) Math expression to evaluate, e.g. 2*(3+4) or 15% of 80 as 0.15*80

Tool input: expression

Input name

expression

Input type

string

Input description

Math expression to evaluate, e.g. 2*(3+4) or 15% of 80 as 0.15*80

Reference value

Use this as the request query or body value and choose “Tool input” in the form.

{{expression}}

Request query (all)

expr: {{expression}}

Field name

expr

Field value

{{expression}}