Assistant CoreAssistant Core
Tools & MCP

Custom API Tools

Tạo HTTP tool riêng để assistant gọi API của bạn — có hỗ trợ authentication.

Custom API Tools phù hợp khi bạn có một HTTP API đơn giản và muốn assistant gọi API đó khi cần. Ví dụ: lookup order, tạo support ticket, kiểm tra inventory, lấy appointment hoặc gửi data vào internal system.

Tạo Tool

  1. Mở Admin Panel.
  2. Chọn assistant.
  3. Vào Tools.
  4. Nhấn New Tool.
  5. Điền tool details (name, URL, method, parameters).
  6. Cấu hình authentication nếu API yêu cầu.
  7. Nhấn Create hoặc Save.

Fields

FieldÝ nghĩa
NameTên ngắn gọn để assistant nhận biết tool. Nên dùng tên mô tả action, ví dụ lookup_order
DescriptionMô tả khi nào nên dùng tool. Phần này rất quan trọng vì AI dùng nó để quyết định có call tool hay không
MethodHTTP method: GET, POST, PUT, PATCH hoặc DELETE
API URLEndpoint mà Assistant Core sẽ call
ParametersData assistant cần lấy từ user trước khi call API
StrictKhi bật, parameter schema được kiểm soát chặt hơn để giảm unexpected input

Authentication

Nếu API của bạn yêu cầu authentication, bạn có thể cấu hình trực tiếp trên mỗi tool — không cần tạo proxy endpoint.

Auth TypeCredential cần điềnHeader được tạo
None(không cần)(không gửi header)
BearerToken (ví dụ: sk-abc123)Authorization: Bearer sk-abc123
API KeyAPI key valueX-API-Key: <value> (hoặc header tùy chỉnh)
Basicusername:passwordAuthorization: Basic <base64 encoded>
Custom HeaderGiá trị header<Header Name>: <value>

Credential được mã hóa AES-256 trước khi lưu vào database. Admin UI chỉ hiện trạng thái "Credential saved (encrypted)" — không bao giờ hiển thị credential gốc.

Khi update tool, nếu bạn để trống credential thì credential cũ sẽ được giữ nguyên. Chỉ điền credential mới khi bạn muốn thay đổi.

Parameters

Mỗi parameter gồm:

FieldÝ nghĩa
NameParameter name gửi đến API
TypeData type: string, number, integer, boolean hoặc array
DescriptionGiải thích rõ parameter này là gì
RequiredBắt buộc hay không
Enum valuesAllowed values nếu assistant chỉ nên chọn trong một số option
Items typeItem type nếu parameter là array

Request Format

MethodParameter format
GETQuery string
DELETEQuery string
POSTJSON body
PUTJSON body
PATCHJSON body

Ví Dụ

Order lookup tool (có authentication):

FieldValue
Namelookup_order
DescriptionTìm shipping status theo order ID khi user hỏi về trạng thái giao hàng
MethodGET
API URLhttps://api.example.com/orders/status
Auth TypeBearer
Credentialyour-api-token-here
ParameterRequired string parameter tên order_id

Khi user hỏi "đơn hàng A123 của tôi tới đâu rồi?", assistant có thể call API với order_id=A123 và header Authorization: Bearer your-api-token-here, rồi summarize result cho user.

Security Notes

  • Credential được mã hóa trước khi lưu — không cần lo bị lộ trong database.
  • Nếu API cần authentication phức tạp hơn (OAuth2 flow, mutual TLS), hãy tạo proxy endpoint.
  • Tool description càng rõ, assistant càng ít call nhầm.
  • Nếu một tool có thể thay đổi data, hãy ghi rõ trong description để assistant chỉ call khi user thật sự muốn thực hiện action.

On this page