For the complete documentation index, see llms.txt. This page is also available as Markdown.

Tools Feature Overview

This article introduces what tools are, how tools assist AI assistants, and an overview of tool types supported by MaiAgent

What Are Tools?

Tools are like plugins or extensions for an AI assistant, enabling it to do more than just chat. For example, if an AI assistant has a "Check Weather" tool, it can tell you today's temperature; if it has a "Play Music" tool, it can play music directly for you.

By letting users define a set of "tools" that the AI assistant can use, the AI assistant is able to:

  1. Understand complex user requests.

  2. Automatically determine when a specific tool needs to be used.

  3. Automatically generate the parameters required to call that tool.

This enables the AI assistant to go beyond generating text responses and actually perform a variety of tasks, such as:

  • Querying real-time information: Retrieve the latest stock prices, weather forecasts, flight statuses, etc. from databases or APIs.

  • Executing external operations: Call booking system APIs, control smart home devices, send emails or messages.

  • Processing files: Read, write, or analyze local or cloud documents.

  • Integrating with other software: Operate CRM systems, project management tools, or other enterprise applications.

How Tools Work

A basic tool invocation workflow includes the following steps:

  1. Define tools:

    • Users must first define the relevant parameters for the tools.

    • Configure which tools the AI assistant can use.

    • Each tool must include:

      • A clear Name.

      • An easy-to-understand Description that explains the tool's purpose.

      • Detailed Parameter specifications, including each parameter's name, data type, whether it's required, etc.

  2. User asks a question:

    • The user makes a request to the AI assistant in natural language.

    • Example: "Check tomorrow's weather in Taipei for me."

  3. Model reasoning and tool selection:

    • The LLM inside the AI assistant analyzes the intent of the user's request.

    • The model determines whether a tool is needed and which tool from the available list to use.

    • Example: The model determines that weather information is needed and selects the tool named get_weather.

  4. Generate tool call parameters:

    • The model generates a structured output (typically in JSON format) containing the tool name and its required parameters.

    • Example:

  5. Application executes the tool:

    • The AI assistant's backend application receives and parses the JSON instruction generated by the model.

    • The application executes the corresponding function or calls the external API based on the tool name and parameters in the instruction.

    • Example: The backend calls the weather query API, passing "Taipei" and "tomorrow" as parameters.

  6. Return the result to the model:

    • The application returns the result of the tool execution (typically also in JSON format) back to the AI assistant's model.

    • Example:

  7. Model generates the final response:

    • The model receives the tool execution result and incorporates it into the final natural language response.

    • Example: "Tomorrow's weather in Taipei is expected to be sunny with a temperature of about 25°C."

Key Advantages of Tools

  • Extend AI assistant capabilities: Break free from the limitation of only generating text, enabling the AI assistant to access real-time information and perform real-world tasks.

  • Improve reliability and accuracy: Through structured calls and responses, ensure task instructions are clear and precise, reducing the risk of model "hallucinations" or operational errors.

  • Enable complex automated workflows: Design AI assistants that can autonomously complete multi-step, cross-system tasks, dramatically improving efficiency (e.g., automatically planning a travel itinerary and booking flights and hotels).

  • More natural interaction experience: Users only need to describe their needs in natural language, and the AI assistant can understand and translate them into precise system operations.

Tool Types Supported by MaiAgent

The following major types are currently supported:

API Tools

  • The most commonly used type. Used to connect to and call external HTTP/HTTPS API services.

  • Common applications: Retrieving weather information, querying external databases, triggering webhooks, integrating with third-party services, etc.

  • Required configuration: API endpoint URL, HTTP method, request headers, parameter schema.

MCP Tools

  • Model Context Protocol (MCP) enables collaboration between servers, clients, and hosts through a standardized protocol.

  • Applicable scenarios: Enabling the AI assistant to call external tools for more complex and practical tasks.

  • Required configuration: MCP server URL, parameters, environment variables, etc.

Last updated

Was this helpful?