> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Base Tool • AI Agent SDK

> BaseTool: Abstract base class for all PraisonAI tools.

# BaseTool

> Defined in the [**base**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/base.md) module.

AI Agent

Abstract base class for all PraisonAI tools.

Subclass this to create custom tools that can be:

* Used directly by agents
* Distributed as pip-installable plugins
* Auto-discovered via entry\_points

Attributes:
name: Unique identifier for the tool
description: Human-readable description (used by LLM)
version: Tool version string (default: "1.0.0")
parameters: JSON Schema for parameters (auto-generated if not provided)

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%

graph LR
    agent["Agent"] -- "uses" --> tool["Tool: BaseTool"]
    tool -- "returns" --> result["Result"]
    style tool fill:#189AB4,color:#fff
    style agent fill:#8B0000,color:#fff
    style result fill:#8B0000,color:#fff
```

## Constructor

**dynamic\_schema\_overrides** `Optional`

No description available.

## Properties

**name** `str`

No description available.

**description** `str`

No description available.

**version** `str`

No description available.

**parameters** `Optional`

No description available.

**restart\_safe** `Optional[bool]`

No description available.

**input\_guardrails** `Optional`

No description available.

**output\_guardrails** `Optional`

No description available.

## Methods

> [card] [validate\_class()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BaseTool-validate_class.md)
>
> Validate a tool class before instantiation.

> [card] [run()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BaseTool-run.md)
>
> Execute the tool with given arguments.

> [card] [to\_model\_output()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BaseTool-to_model_output.md)
>
> Optional hook returning a compact, model-facing view of `result`.

> [card] [safe\_run()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BaseTool-safe_run.md)
>
> Execute tool with error handling, returning ToolResult.

> [card] [get\_schema()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BaseTool-get_schema.md)
>
> Get OpenAI-compatible function schema for this tool.

> [card] [validate()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BaseTool-validate.md)
>
> Validate the tool configuration.

> [card] [validate\_schema\_roundtrip()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/BaseTool-validate_schema_roundtrip.md)
>
> Validate that schema can round-trip through OpenAI-style serialization.

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
class WeatherTool(BaseTool):
        name = "get_weather"
        description = "Get current weather for a location"
        
        def run(self, location: str, units: str = "celsius") -> dict:
            # Implementation here
            return {"temp": 22, "condition": "sunny"}
```

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/tools/base.py#L179)
>
> `praisonaiagents/tools/base.py` at line 179

***

## Related Documentation

> [card] [Tools Concept](https://praison.ai/docs/docs/concepts/tools)

> [card] [Create Custom Tools](https://praison.ai/docs/docs/guides/tools/create-custom-tools)

> [card] [Tool Development](https://praison.ai/docs/docs/tutorials/advanced-tool-development)


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