71trust / 100
Calculators Discount Calculator
by AgentTools in Other
x402 APIFailing, checked 1 h ago
Calculate the final sale price and the amount saved for any price and percent-off discount, with the working shown. Use this when an agent needs to sale price and savings from a percent off.
GET https://agenttools-hub.vercel.app/api/v1/calculators/discount-calculator
Last 30 days
All checks passedSome failedAll failedNot checked
- Uptime
- 66.7%
- Response time
- 142 ms typical, 142 ms slowest 5%
- Last check
- 1 h ago: Expected HTTP 402, got 308
- Next check
- any minute now
How to call it
# See the payment challenge (nothing is charged)
curl -i -X GET "https://agenttools-hub.vercel.app/api/v1/calculators/discount-calculator?discount=20&price=79.99"import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client().register(
"eip155:8453",
new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fagenttools-hub.vercel.app%2Fapi%2Fv1%2Fcalculators%2Fdiscount-calculator
const res = await pay("https://agenttools-hub.vercel.app/api/v1/calculators/discount-calculator?discount=20&price=79.99");
console.log(await res.json());Example input
{
"discount": 20,
"price": 79.99
}Example output
{
"result": {
"answer": "63.99",
"answerLabel": "Final price after 20% off",
"details": [
{
"label": "You save",
"value": "16"
},
{
"label": "Original price",
"value": "79.99"
}
],
"steps": [
"Savings = 79.99 × 20 ÷ 100 = 16",
"Final price = 79.99 − 16 = 63.99"
],
"value": 63.992
},
"tool": "discount-calculator"
}Security scan
- No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 1 h ago | Expected HTTP 402, got 308 | 308 | 13 ms | - |
| 5 h ago | Passed | 402 | 220 ms | $0.002 |
| 10 h ago | Passed | 402 | 142 ms | $0.002 |