Overview
Functions (also called tools or actions) are HTTP endpoints you define inside an AI Agent. When the agent determines that a function is relevant to answering a user’s question, it extracts the required parameters from the conversation, calls your endpoint, and incorporates the response in its reply — all in a single turn. The agent decides when to call a function based on the function’s description and the user’s message. You do not need to build explicit routing logic. The language model handles that decision.Prerequisites
- An AI Agent configured with a system prompt — see Prompt Engineering
- An HTTP endpoint that accepts requests and returns JSON responses
- (Recommended) Understanding of JSON Schema — functions use it to describe parameters
When to Use Functions
Functions are the right tool when the answer requires data that changes in real time or is specific to the authenticated user:- Check order status from your ERP or order management system
- Look up appointment availability in your booking system
- Create or update a contact record in your CRM
- Send a Slack or email notification when a lead qualifies
- Fetch a real-time product price or inventory level
- Submit a support ticket on the customer’s behalf
How Functions Work
- You define a function: name, description, HTTP method, URL, headers, and a JSON Schema describing its parameters.
- During a conversation, the language model reads the function’s description and decides whether it applies to the user’s current message.
- If it applies, the model extracts the parameter values from the conversation and Fliqr AI calls your endpoint.
- Your API returns a JSON response. Fliqr AI passes that response back to the model.
- The model writes a reply to the user using the returned data.
Add a Function to an Agent
1
Open the Functions tab
Go to AI Agents → select your agent → Functions tab.
2
Add a new function
Click Add Function. A configuration panel opens with fields for name, description, method, URL, headers, and parameters.
3
Enter the function name and description
The name is used internally (no spaces — use underscores). The description is what the language model reads to decide when to call this function. Write it as a clear, specific explanation of what the function does and what triggers it.
4
Set the HTTP method and URL
Select the HTTP method (GET, POST, PUT, PATCH, DELETE) and enter your endpoint URL. Use
{{parameter_name}} placeholders in the URL for path parameters.5
Add authentication headers
If your endpoint requires authentication, add the necessary headers. Use
{{secret_key}} notation to reference secrets stored in your Fliqr AI environment — do not hard-code credentials.6
Define the parameter schema
Define each parameter the function needs. For each parameter, specify its type, a description, and whether it is required.
7
Save and test
Click Save, then open the Playground and send a message that should trigger the function (e.g., “What’s the status of order #4821?”). Verify that the agent calls the function and incorporates the response correctly.
Example Function Definition
The following example defines a function that retrieves an order’s status from an external API. You can use this as a starting template.Structuring Function Results as Chat Messages
When a function returns data that should be presented as a structured message — a product card, a list of options, or a set of quick replies — combine function calls with JSON output prompting. Add an instruction to your system prompt:Multiple Functions on One Agent
You can add multiple functions to a single agent. The model selects the right function based on each function’s description. To avoid unintended calls:- Keep each function’s description specific about its trigger conditions.
- If two functions cover similar topics, differentiate them clearly in the description (e.g., “use this for order status, not for return requests”).
- Test each function individually in the Playground before testing combinations.
Built-in and Flow-triggered functions
Besides custom HTTP tools, Fliqr AI supports AI Functions that collect parameters and trigger a Flow (for example booking or weather lookup). Create them under AI Center → AI Tools → AI Functions. Naming tips:- Use multi-word names:
get_current_weather,book_appointment - Start descriptions with “Allows the user to…”
- Use meaningful parameter names (
email, not random codes) - Prefer returning the customer-facing result via a custom field output message so the Agent can rewrite it naturally
What’s next
MCP servers
Attach MCP tools without writing every HTTP function.
Prompt engineering
Teach the agent when to call each tool.
Human handover
Built-in path when AI should stop.
Rich responses
Format tool results as buttons and cards.