{"uid":"cap_LIbMZpFSM9Hj0hEjJUM6E","slug":"agent402-tools-arithmetic-expression-calculator-0c0f1852","name":"agent402.tools Arithmetic Expression Calculator","description":"Safely evaluate an arithmetic expression (+ - * / % ^ and parentheses). No code execution - a real parser, not eval.","url":"https://agent402.tools/api/calc","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"expr":{"type":"string"}}},"responseSchema":{"type":"json","example":{"result":29}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_zch_mc0z566Ti8Q1Xqn7h","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Safely evaluates an arithmetic expression string (supporting +, -, *, /, %, ^, and parentheses) using a real parser — no code execution or eval.","exampleAgentPrompt":"What is (3 + 5) * 12 / (2 ^ 3) - 7 % 4? Can you evaluate that arithmetic expression for me?","exampleUseCases":null,"resultDescription":"A numeric value representing the result of the evaluated arithmetic expression.","failureModes":["Invalid or malformed expression returns an error (e.g. unmatched parentheses, unsupported operators)","Division by zero raises an error","Empty expression string returns an error","Non-arithmetic input (e.g. letters, function calls) rejected","Payment failure (402) if USDC not provided or insufficient"],"whenToPreferThis":"Prefer this endpoint when you need safe, sandboxed arithmetic evaluation without executing arbitrary code — especially when the expression comes from untrusted or user-supplied input. Ideal for agents that need to compute math formulas, handle operator precedence correctly, and avoid the security risks of eval-based approaches.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T19:14:03.138Z","isFirstParty":false}