@ menu.
Custom API tools
Custom API tools connect your agent to any REST endpoint so it can fetch data, trigger workflows, or hand off complex tasks.General configuration
- Name – A descriptive label the agent can reference.
- Icon URL – An image that appears alongside the tool in the dashboard.
- Slug – A URL-friendly identifier (for example
example-api-tool). - Description – Explain what the tool does and when to use it.
- Method – Pick the HTTP verb (
GET,POST,PUT,DELETE, etc.). - Endpoint URL – Provide the full URL to your API.
Headers
Add headers in JSON format to send with every request:Body template
ForPOST or PUT requests, define a body template. Templates support Handlebars so you can inject data from the CometChat context:
{{uid}}– Sender’s user ID.{{role}}– Sender’s role.- Custom fields from
messageMetadata(for example{{customMetadataField}}).
Authentication (Basic Auth)
- Toggle Enable under Basic Authentication.
- Enter the User Name.
- Enter the Password or token.
Parameters
Define each parameter so the agent understands what to supply at run-time:- Key – Parameter name passed to your API.
- Type – Data type (
string,number,boolean, etc.). - Description – Plain-language guidance for the agent.
- Required – Mark mandatory fields to prevent incomplete requests.
Reference in instructions
Once saved, the custom API tool appears in the@ tool list. Embed it within instructions to explain when and how the agent should call it. Example: “When users ask for weather information, use @weather-api-tool with the city parameter.”
Send sample conversations through the Test console to confirm your tool receives well-formed payloads and responses. Update instructions if the agent needs extra context.