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

# Include Exclude Tools Custom Toolkit

> Restrict a custom customer database Toolkit to read-only functions with include_tools.

```python include_exclude_tools_custom_toolkit.py theme={null}
"""
Include Exclude Tools Custom Toolkit
=============================

Demonstrates include exclude tools custom toolkit.
"""

import asyncio
import json

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools import Toolkit
from agno.utils.log import logger

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------


class CustomerDBTools(Toolkit):
    def __init__(self, *args, **kwargs):
        super().__init__(
            name="customer_db",
            tools=[self.retrieve_customer_profile, self.delete_customer_profile],
            *args,
            **kwargs,
        )

    async def retrieve_customer_profile(self, customer_id: str):
        """
        Retrieves a customer profile from the database.

        Args:
            customer_id: The ID of the customer to retrieve.

        Returns:
            A string containing the customer profile.
        """
        logger.info(f"Looking up customer profile for {customer_id}")
        return json.dumps(
            {
                "customer_id": customer_id,
                "name": "John Doe",
                "email": "john.doe@example.com",
            }
        )

    def delete_customer_profile(self, customer_id: str):
        """
        Deletes a customer profile from the database.

        Args:
            customer_id: The ID of the customer to delete.
        """
        logger.info(f"Deleting customer profile for {customer_id}")
        return f"Customer profile for {customer_id}"


agent = Agent(
    model=OpenAIChat(id="gpt-5.2"),
    tools=[CustomerDBTools(include_tools=["retrieve_customer_profile"])],
)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    asyncio.run(
        agent.aprint_response(
            "Retrieve the customer profile for customer ID 123 and delete it.",  # The agent shouldn't be able to delete the profile
            markdown=True,
        )
    )
```

## Run the Example

<Snippet file="create-venv-step.mdx" />

**1. Install dependencies**

```bash theme={null}
uv pip install -U agno openai
```

**2. Export your OpenAI API key**

```bash Mac/Linux theme={null}
export OPENAI_API_KEY="your_openai_api_key_here"
```

```bash Windows theme={null}
$Env:OPENAI_API_KEY="your_openai_api_key_here"
```

**3. Run the example**

Save the code above as `include_exclude_tools_custom_toolkit.py`, then run:

```bash theme={null}
python include_exclude_tools_custom_toolkit.py
```

Full source: [cookbook/91\_tools/other/include\_exclude\_tools\_custom\_toolkit.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/91_tools/other/include_exclude_tools_custom_toolkit.py)


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