# ToolsContainer

## Overview

A tool container is essentially a class that houses the methods representing the tools (referred to as plugins in Semantic Kernel). This class does not need to extend any other class; it can simply be a Plain Old CLR Object (POCO) or extend any other class within an application.

However, if your tools class extends the [`Wisej.AI.Tools.ToolsContainer`](/ai/components/api/tools/wisej.ai.tools.toolscontainer.md) class, it gains additional integration and context when used by an adapter. If you need to extend a pre-existing class in your code and still require this additional contextual integration, you can implement the `IToolsContainer` interface instead of inheriting from `ToolsContainer`.

Inheriting from `ToolsContainer` provides the following additional features to your code:

* Automatic service injection
* Reference to the current [Hub](/ai/components/api/tools/wisej.ai.tools.toolscontainer.md#hub)
* Reference to the [Adapter](/ai/components/api/tools/wisej.ai.tools.toolscontainer.md#adapter) utilizing the tools
* [Parameters](/ai/components/api/tools/wisej.ai.tools.toolscontainer.md#parameters) collection to replace the placeholders in the tools' prompts

The Parameters collection is a particularly interesting feature, as it allows the tool to set the values of placeholders in its own prompts. This enables more dynamic tool implementations.

## Parameters

Below is the description of the [DatabaseTools](/ai/components/built-in-smarttools/databasetools.md). You will notice two placeholders that remain unresolved until the class instance is created and initialized. If the description were merely fixed text in a \[Description] attribute, it would offer limited flexibility.

````ini
#
# DatabaseTools
#
[DatabaseTools]
Provides tools to access the database.
Unless instructed otherwise, use it before the web search tools.

Instructions:
- Use only the tables defined in the Database Schema.
- The generated SQL statement MUST be valid for "{{server-type}}".
- Define column aliases within single quotes.
- Enclose column names in [].

```Database Schema
{{database-schema}}
```
````

When inheriting from the ToolsContainer or implementing IToolsContainer, you have the flexibility to set parameters at any time before sending a request to the AI. You can do this as follows:

```csharp
this.Parameters.Add("server-type", serverType);
this.Parameters.Add("database-schema", schema);
```

It can also replace parameters that are not directly related to the tool, as well as parameters used in the tool's description and all the arguments of the methods within the tools container.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/ai/components/built-in-smarttools/toolscontainer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
