CalculateTool class

Evaluates a mathematical expression.

Supports: +, -, *, /, %, ^, parentheses, sqrt(), abs(), floor(), ceil(), pi, e, and standard integer/float literals.

Does NOT use dart:mirrors or eval — uses a recursive descent parser so it is safe to run in AOT-compiled Flutter apps.

Inheritance

Constructors

CalculateTool()
const

Properties

description → String
One-sentence description included in the system prompt.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
inputSchema → Map<String, String>
Schema of expected input keys and their descriptions.
no setteroverride
isIdempotent → bool
Whether this tool can safely be retried on failure.
no setterinherited
name → String
Unique snake_case name the LLM uses to invoke this tool.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run(Map<String, dynamic> input) → Future<ToolResult>
Executes the tool with the given input map.
override
toString() → String
A string representation of this object.
inherited
validate(Map<String, dynamic> input) → String?
Validates the input map against inputSchema.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited