ReadonlyschemaThe schema definition for the CalculatorTool, conforming to the ToolSchema interface.
It defines the tool's name, description, input parameters (expression and optional scope),
and provides examples for the LLM.
Static ReadonlytoolThe unique name identifier for this tool.
Executes the calculator tool by evaluating the provided mathematical expression.
It uses a restricted scope including only allowed mathjs functions and any variables
passed in the input.scope. Handles basic number and complex number results.
An object containing the expression (string) and optional scope (object). Must match inputSchema.
The execution context containing threadId, traceId, etc.
A promise resolving to a ToolResult object.
On success, status is 'success' and output is { result: number | string }.
On failure, status is 'error' and error contains the error message.
An ART Framework tool that safely evaluates mathematical expressions using the mathjs library. It supports basic arithmetic, variables via a scope, complex numbers, and a predefined list of safe functions.
This tool is designed to be used within the ART framework's
ToolSystem. It provides a safe way to perform mathematical calculations by leveraging themathjslibrary. The tool validates the input expression to ensure it's a single, valid mathematical expression before evaluation.See