> ## 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.

# Load Tools From Tools Py • AI Agents Framework

> load_tools_from_tools_py: Imports and returns all contents from tools.py file.

# load\_tools\_from\_tools\_py

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**AgentsGenerator**](../classes/AgentsGenerator) class in the [**agents\_generator**](../modules/agents_generator) module.

Imports and returns all contents from tools.py file.
Also adds the tools to the global namespace.

```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: load_tools_from_tools_py"]
    tool -- "returns" --> result["Result"]
    style tool fill:#189AB4,color:#fff
    style agent fill:#8B0000,color:#fff
    style result fill:#8B0000,color:#fff
```

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def load_tools_from_tools_py() -> Any
```

### Returns

<ResponseField name="Returns" type="Any">
  A list of callable functions with proper formatting
</ResponseField>

## Uses

* `spec_from_file_location`
* `debug`
* `module_from_spec`
* `exec_module`
* `inspect.getmembers`
* `callable`
* `inspect.isclass`
* `globals`
* `warning`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai/praisonai/agents_generator.py#L292">
  `praisonai/agents_generator.py` at line 292
</Card>

***

## Related Documentation

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

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

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