Skip to main content

How to Add Custom Function or Tool Actions

Written by Miguel from SalesCloser
Updated over 10 months ago

Actions let your AI agent interact with external sources (APIs) or validate data in real-time during a call. Here’s how to create and assign these actions:

Step 1: Navigate to the Actions Panel

  1. Go to your AI Agent.

  2. Scroll to the “Actions” section.

  3. Click on “Add Actions”.

Step 2: Choose to Create a New Action or Reuse an Existing One

  • You’ll see a list of previously created actions.

  • Click “Create new Action +” to build a new one from scratch.

  • Or, select an existing action if one has already been configured for your use case.

Step 3: Define Your Action

1. Title

  • Enter a descriptive name for the action (e.g., "Get Customer Info", "Check Weather", "Lookup Lead").

2. Authentication

  • Choose the authentication type required for the API:

    • None – no authentication required

    • API Key – enter your API key and select auth type: Basic, Bearer, or Custom

1. Basic Authentication

  • How it works: Sends the API Key in a username: password format (most commonly, the key is the username and the password is left blank).

Header format:

Authorization: Basic <base64-encoded-string>

  • Use case: Often used when APIs still follow older standards or when a username/password combo is required.

2. Bearer Authentication

  • How it works: Sends the API Key as a Bearer token in the Authorization header.

Header format:

Authorization: Bearer YOUR_API_KEY

  • Use case: This is the most common and secure way to authenticate with modern APIs (e.g., Stripe, GitHub, etc.).

3. Custom Authentication

  • How it works: Gives you flexibility to place the API Key wherever the API expects it.

  • Examples:

In a header like:

x-api-key: YOUR_API_KEY

In the query string:

  • Use case: When the API doesn’t follow standard practices and needs the key in a specific place or under a specific name

Step 4: Enter the API Schema

  • Paste your OpenAPI schema (JSON format) into the Schema field.

  • Example:

{

"openapi": "3.1.0",

"info": { "title": "Get weather data", "version": "v1.0.0" },

"servers": [{ "url": "https://weather.example.com" }],

"paths": {

"/location": {

"get": {

"description": "Get temperature for a location",

"operationId": "GetCurrentWeather"

}

}

}

}

  • You can also use predefined schema examples via the "Examples" dropdown for reference.

Step 5: Select an Available Action

  • Once the schema is added, it will generate a list of Available Actions (based on operationId).

  • Click “Test” to test that the API works.

Step 6: Your Action is Now Ready

  • Once saved, the action will be listed under the agent’s Assigned Actions.

  • These can now be triggered during the call sequence when configured in your workflow.


How to Trigger the Action Using a Prompt

To activate a Custom Action during a call, you must include a clear instruction in the agent’s prompt. This tells the AI when to trigger the tool.

Example prompt structure:

"Once the customer provides their zip code, call the GetWeatherData function to get the weather for that location."

Make sure the function name matches the action name in your configuration. This helps the agent know exactly when and which function to trigger.

✅ Notes

  • Saved actions are stored in your account under Profile > Agent Actions for reuse. You can also edit or delete any saved actions here.

  • You can assign different actions to different agents based on what tools you want them to call.

  • If you encounter errors, verify your API URL, authentication, and schema structure.

For any questions, contact us at hello@salescloser.ai or visit our website at https://salescloser.ai/

Did this answer your question?