Skip to content

API Reference parrot_tools.math

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.math

View source

Alias AbstractTool

Re-exported from parrot_tools.abstract.AbstractTool.

Class MathTool

A tool for performing basic arithmetic operations.

Parameter Type Default Description
**kwargs {}

Method MathTool.add

Add two numbers.

add(a: float, b: float) -> float

Parameter Type Default Description
a float
b float

Returns: float

Method MathTool.subtract

Subtract two numbers.

subtract(a: float, b: float) -> float

Parameter Type Default Description
a float
b float

Returns: float

Method MathTool.multiply

Multiply two numbers.

multiply(a: float, b: float) -> float

Parameter Type Default Description
a float
b float

Returns: float

Method MathTool.divide

Divide two numbers.

divide(a: float, b: float) -> float

Parameter Type Default Description
a float
b float

Returns: float

Method MathTool.sqrt

Calculate the square root of a number.

sqrt(a: float) -> float

Parameter Type Default Description
a float

Returns: float

Class MathToolArgs

Arguments schema for MathTool.

Fields:

Field Type Default Description
a float The number for unary operations, or the first number for binary operations.
operation str Mathematical operation. Supports: add, subtract, multiply, divide, sqrt.
b Optional[float] None The second number for binary operations. Not used for unary operations like square root.

Method MathToolArgs.validate_operation

Normalize operation names to internal format.

validate_operation(v: str) -> str

Parameter Type Default Description
v str

Returns: str

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally