Tool feature descriptions

What is a tool?

A "tool" is a core mechanism that gives the AI assistant the ability to interact with the outside world (such as databases, APIs, or other services) and perform concrete actions.

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

  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 do more than just generate text replies; it can actually perform a variety of tasks, for example:

  • Query real-time information: Obtain up-to-date stock prices, weather forecasts, flight statuses, etc., from databases or APIs.

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

  • Handle files: Read, write, or analyze local or cloud files.

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

How tools work

A basic tool call flow includes the following steps:

  1. Define tools:

    • The user must first define the relevant parameters of the tool.

    • Set up the tool items that the AI assistant can use.

    • Each tool must include:

      • A clearname (Name).

      • An easy-to-understanddescription (Description) explaining the tool's purpose.

      • Detailedparameter descriptions (Parameters), including each parameter's name, data type, whether it is required, etc.

  2. User query:

    • The user requests something from the AI assistant in natural language.

    • Example: "Help me check the weather in Taipei for tomorrow."

  3. Model reasoning and tool selection:

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

    • The model determines from the list of available tools whether it needs to use a tool and which tool to use to respond to the request.

    • Example: The model decides it needs weather information and selects a tool named get_weather tool.

  4. Generate tool call parameters:

    • The model generates a structured output (usually in JSON format) that includes the name of the tool to call and the required parameters.

    • Example:

    {
      "name": "get_weather",
      "arguments": {
        "city": "Taipei",
        "date": "tomorrow"
      }
    }
  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 an external API based on the tool name and parameters in the instruction.

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

  6. Return results to the model:

    • The application returns the results obtained from executing the tool (usually also in JSON format) to the AI assistant's model.

    • Example:

    {
      "temperature": "25°C",
      "condition": "Sunny"
    }
  7. Model generates the final reply:

    • The model receives the tool execution results and integrates them into the final natural language response.

    • Example: "The weather in Taipei tomorrow is expected to be sunny, with a temperature of about 25°C."

Main advantages of tools

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

  • Improve reliability and accuracy: Through structured calls and returns, ensure task instructions are clear and reduce the risk of the model "hallucinating" or making operational errors.

  • Enable complex automation workflows: Be able to design AI assistants that autonomously complete multi-step, cross-system tasks, greatly improving efficiency (for example: automatically planning a trip and booking flights and hotels).

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

MaiAgent supported tool types

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, parameters schema.

☁️ MCP tools

  • Model Context Protocol(Model Context Protocol, MCP), achieves collaboration between server, client, and host through a standardized protocol.

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

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

Last updated

Was this helpful?