> For the complete documentation index, see [llms.txt](https://docs.makerobos.com/frontman-enterprise-chatbot-platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.makerobos.com/frontman-enterprise-chatbot-platform/instinct-ai/ai-agents/function-calling.md).

# Function Calling

The Function Calling AI Agent is a tool designed to interact with external APIs based on defined criteria. It offers flexibility in configuring API requests, including HTTP methods, request bodies, and headers.

### **How To Use It**

1. **Access AI Agents:** Navigate to the AI Agents section within the platform.

   <figure><img src="https://3746379134-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamP4egBrOsuezKyj1NQl%2Fuploads%2F9CP5rCf3UQ3U8MgZpsyJ%2Fcustom%20agent%201.png?alt=media&amp;token=e9aee971-69f8-4853-a0eb-6c85db58a08a" alt=""><figcaption></figcaption></figure>
2. **Select Agent:** Choose the "Function Calling" agent from the available options.

   <figure><img src="https://3746379134-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamP4egBrOsuezKyj1NQl%2Fuploads%2Fmf2h6faYWVG6gn9J1vuJ%2Fcustom%20agent.png?alt=media&amp;token=0df38f37-10a2-4c76-b705-dda64f0466d7" alt=""><figcaption></figcaption></figure>
3. **Deploy Agent:** Click the "Deploy" button to initiate the agent creation process.
4. **Agent Configuration:**

   * **Agent Name:** Assign a unique identifier or descriptive name (e.g., "API Connector").
   * **Prompt Description:** Briefly outline the agent's purpose (e.g., "Connects to external APIs when user asks to book a meeting").
   * **AI Criteria:** Define conditions or events that trigger the agent's activation.

   <figure><img src="https://3746379134-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamP4egBrOsuezKyj1NQl%2Fuploads%2FFqVmUjJc7q70yBkd8WPn%2Fcustom%20agent2.png?alt=media&amp;token=e45d2904-730b-4e8c-b13e-0b331b1c6f92" alt=""><figcaption></figcaption></figure>
5. **API Configuration**
   1. **API Endpoint:** Specify the target API's URL.
   2. **HTTP Method:** Select the appropriate HTTP method (GET, POST, PUT, PATCH, DELETE).
   3. **Request Body:** Construct the request body using the provided format options (JSON, XML, etc.).
   4. **Headers:** Define custom headers for the request.
   5. **Query Parameters:** Add query parameters to the URL.
   6. **Test Request:** Validate the API configuration by sending a test request.

      <figure><img src="https://3746379134-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamP4egBrOsuezKyj1NQl%2Fuploads%2FOVudVav7G96OAG4mMRp0%2Fcustom%20agent3.png?alt=media&amp;token=d0b1e246-200c-4c72-a527-0555d0538879" alt=""><figcaption></figcaption></figure>
6. **Execution**
   1. **Trigger Activation:** When the defined AI criteria are met, the agent is activated.
   2. **API Call:** The agent sends the configured API request to the specified endpoint.
   3. **Response Handling:** The agent processes the API response based on predefined rules or user-defined actions.
