# Tool Features Overview

## What are Tools?

Tools are like **plugins** or **skills** for AI agents, enabling them to do more than just chat. For example, if an AI agent has a "**check weather**" tool, it can tell you today's temperature; if it has a "**play music**" tool, it can directly open music for you.

By allowing users to define a set of "tools" that the AI agent can use, the AI agent can:

1. Understand users' complex requests.
2. Automatically determine when a specific tool needs to be used.
3. Automatically generate the parameters required to call that tool.

This enables AI agents to go beyond generating text responses and actually execute diverse tasks, such as:

* **Querying real-time information:** Retrieving the latest stock prices, weather forecasts, flight status, etc., from databases or APIs.
* **Executing external operations:** Calling booking system APIs, controlling smart home devices, sending emails or messages.
* **Processing files:** Reading, writing, or analyzing local or cloud files.
* **Integrating with other software:** Operating CRM systems, project management tools, or other enterprise applications.

<figure><img src="/files/z72ll6gk160JZY6tzWWs" alt=""><figcaption></figcaption></figure>

## How Tools Work

A basic tool calling workflow includes the following steps:

1. **Define the Tool:**
   * Users must first define the tool's relevant parameters.
   * Set up the list of tools available to the AI agent.
   * Each tool must include:
     * A clear **Name**.
     * An easy-to-understand **Description** explaining the tool's purpose.
     * Detailed **Parameter descriptions** (Parameters), including each parameter's name, data type, whether it's required, etc.
2. **User Asks a Question:**
   * The user submits a request to the AI agent in natural language.
   * *Example:* "Help me check tomorrow's weather in Taipei."
3. **Model Thinks and Selects Tool:**
   * The LLM inside the AI agent analyzes the intent of the user's request.
   * The model determines whether and which tool from the available tool list is needed to respond to the request.
   * *Example:* The model determines weather information is needed and selects the tool named `get_weather`.
4. **Generate Tool Call Parameters:**

   * The model generates a structured output (usually in JSON format) containing the tool name to call and its required parameters.
   * *Example:*

   ```json
   {
     "name": "get_weather",
     "arguments": {
       "city": "Taipei",
       "date": "tomorrow"
     }
   }
   ```
5. **Application Executes the Tool:**
   * The AI agent's backend application receives and parses the JSON instructions generated by the model.
   * The application executes the corresponding function or calls external APIs based on the tool name and parameters in the instructions.
   * *Example:* The backend program calls the weather query API, passing "Taipei" and "tomorrow" as parameters.
6. **Return Results to Model:**

   * The application returns the results obtained from executing the tool (usually also in JSON format) back to the AI agent's model.
   * *Example:*

   ```json
   {
     "temperature": "25°C",
     "condition": "sunny"
   }
   ```
7. **Model Generates Final Response:**
   * The model receives the tool execution results and integrates them into the final natural language response.
   * *Example:* "Tomorrow's weather in Taipei is expected to be sunny with a temperature of approximately 25°C."

<figure><img src="/files/MLootTNjzvu1qLUumvy8" alt=""><figcaption></figcaption></figure>

## Key Advantages of Tools

* **Extend AI Agent Capabilities:** Break through the limitation of only generating text, allowing AI agents to access real-time information and execute real-world tasks.
* **Improve Reliability and Accuracy:** Through structured calls and returns, ensure task instructions are clear and explicit, reducing the risk of model "hallucinations" or operational errors.
* **Enable Complex Automation Workflows:** Design AI agents that can autonomously complete multi-step, cross-system tasks, significantly improving efficiency (e.g., automatically planning travel itineraries and booking flights and hotels).
* **More Natural Interaction Experience:** Users only need to describe their needs in natural language, and the AI agent can understand and convert them into precise system operations.

## Tool Types Supported by MaiAgent

Currently supports the following main types:

### 🌐 API Tools

* **Most commonly used type**. Used to connect and call external HTTP/HTTPS API services.
* **Common applications**: Obtaining weather information, querying external databases, triggering webhooks, integrating with third-party services, etc.
* **Required configuration**: API endpoint URL, HTTP method, request headers (Headers), parameter structure (Parameters Schema).

### ☁️ MCP Tools

* **Model Context Protocol (MCP)**, enables collaboration between servers, clients, and hosts through standardized protocols.
* **Use cases**: Allows AI agents to call external tools to perform more complex and practical tasks.
* **Required configuration**: MCP server URL, parameters, environment variables, etc.


---

# 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.maiagent.ai/maiagent-user-guide/maiagent-user-guide-en/tools/tool_description.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.
