Tool Features 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 skills for AI assistants, enabling them 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 directly play music for you.

By allowing users to define a set of tools available to the AI assistant, the AI assistant can:

  1. Understand complex user requests.

  2. Automatically determine when to use specific tools.

  3. Automatically generate parameters needed to call the tools.

This enables AI assistants to do more than just generate text responses, allowing them to perform various tasks such as:

  • Query Real-time Information: Get latest stock prices, weather forecasts, flight status, etc. from databases or APIs.

  • Execute External Operations: Call ticket booking 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 calling process includes these steps:

  1. Define Tools:

    • Users need to define tool parameters first.

    • Set available tools for the AI assistant.

    • Each tool must include:

      • Clear Name

      • Easy to understand Description explaining the tool's purpose

      • Detailed Parameters including parameter names, data types, required fields, etc.

  2. User Query:

    • Users make requests to the AI assistant in natural language.

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

  3. Model Thinking and Tool Selection:

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

    • The model determines if and which tools are needed from the available tool list.

    • Example: Model determines weather information is needed and selects the get_weather tool.

  4. Generate Tool Call Parameters:

    • Model generates structured output (usually JSON format) containing tool name and required parameters.

    • Example:

    {
      "name": "get_weather", 
      "arguments": {
        "city": "Taipei",
        "date": "tomorrow"
      }
    }
  5. Application Executes Tool:

    • AI assistant's backend application receives and parses the JSON command.

    • Application executes corresponding function or calls external API based on tool name and parameters.

    • Example: Backend calls weather API with "Taipei" and "tomorrow" as parameters.

  6. Return Results to Model:

    • Application returns tool execution results (usually in JSON format) to the AI assistant model.

    • Example:

    {
      "temperature": "25°C",
      "condition": "Sunny"
    }
  7. Model Generates Final Response:

    • Model receives tool execution results and integrates them into final natural language response.

    • Example: "Tomorrow's weather in Taipei is forecast to be sunny with temperature around 25°C."

Main Benefits of Tools

  • Expand AI Assistant Capabilities: Break free from text-only generation limits, allowing AI assistants to access real-time information and execute real-world tasks.

  • Improve Reliability and Accuracy: Ensure clear task instructions through structured calls and returns, reducing risks of model "hallucinations" or operational errors.

  • Enable Complex Automation: Design AI assistants that can independently complete multi-step, cross-system tasks, greatly improving efficiency (e.g., automatically planning trips and booking flights/hotels).

  • More Natural Interaction: Users only need to describe requirements in natural language, and AI assistants can understand and transform them into precise system operations.

Tool Types Supported by MaiAgent

Currently supports these main types:

🌐 API Tools

  • Most common type. Used to connect and call external HTTP/HTTPS API services.

  • Common Applications: Get weather information, query external databases, trigger webhooks, integrate with third-party services, etc.

  • Required Configuration: API endpoint URL, HTTP method, request headers, parameters schema.

☁️ MCP Tools

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

  • Use Cases: Allow AI assistants 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?