> ## 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**](../modules/base) module.

<Badge color="blue">AI Agent</Badge>

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

<ParamField query="dynamic_schema_overrides" type="Optional" required={false}>
  No description available.
</ParamField>

## Properties

<ResponseField name="name" type="str">
  No description available.
</ResponseField>

<ResponseField name="description" type="str">
  No description available.
</ResponseField>

<ResponseField name="version" type="str">
  No description available.
</ResponseField>

<ResponseField name="parameters" type="Optional">
  No description available.
</ResponseField>

## Methods

<CardGroup cols={2}>
  <Card title="validate_class()" icon="function" href="../functions/BaseTool-validate_class">
    Validate a tool class before instantiation.
  </Card>

  <Card title="run()" icon="function" href="../functions/BaseTool-run">
    Execute the tool with given arguments.
  </Card>

  <Card title="to_model_output()" icon="function" href="../functions/BaseTool-to_model_output">
    Optional hook returning a compact, model-facing view of `result`.
  </Card>

  <Card title="safe_run()" icon="function" href="../functions/BaseTool-safe_run">
    Execute tool with error handling, returning ToolResult.
  </Card>

  <Card title="get_schema()" icon="function" href="../functions/BaseTool-get_schema">
    Get OpenAI-compatible function schema for this tool.
  </Card>

  <Card title="validate()" icon="function" href="../functions/BaseTool-validate">
    Validate the tool configuration.
  </Card>

  <Card title="validate_schema_roundtrip()" icon="function" href="../functions/BaseTool-validate_schema_roundtrip">
    Validate that schema can round-trip through OpenAI-style serialization.
  </Card>
</CardGroup>

## 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 title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/tools/base.py#L179">
  `praisonaiagents/tools/base.py` at line 179
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Tools Concept" icon="wrench" href="/docs/docs/concepts/tools" />

  <Card title="Create Custom Tools" icon="plus" href="/docs/docs/guides/tools/create-custom-tools" />

  <Card title="Tool Development" icon="code" href="/docs/docs/tutorials/advanced-tool-development" />
</CardGroup>
