> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Calculator

> CalculatorTools gives an agent add, subtract, multiply, divide, and other math operations for step-by-step calculations.

**CalculatorTools** enables an Agent to perform mathematical calculations.

## Example

The following agent will calculate the result of `10*5` and then raise it to the power of `2`:

```python cookbook/91_tools/calculator_tools.py theme={null}
from agno.agent import Agent
from agno.tools.calculator import CalculatorTools

agent = Agent(
    tools=[CalculatorTools()],
    markdown=True,
)

agent.print_response("What is 10*5 then to the power of 2, do it step by step")
```

## Toolkit Functions

| Function | Description |
| - | - |
| `add` | Adds two numbers and returns the result. |
| `subtract` | Subtracts the second number from the first and returns the result. |
| `multiply` | Multiplies two numbers and returns the result. |
| `divide` | Divides the first number by the second and returns the result. Handles division by zero. |
| `exponentiate` | Raises the first number to the power of the second number and returns the result. |
| `factorial` | Calculates the factorial of a number and returns the result. Handles negative numbers. |
| `is_prime` | Checks if a number is prime and returns the result. |
| `square_root` | Calculates the square root of a number and returns the result. Handles negative numbers. |

You can use `include_tools` or `exclude_tools` to modify the list of tools the agent has access to. Learn more about [selecting tools](https://agno-v2.mintlify.site/tools/selecting-tools.md).

## Developer Resources

* [Tools](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/calculator.py)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.