Skip to main content
Add functions to actions to extend your agent’s capabilities with custom logic — look up data, call APIs, or perform calculations during a conversation.

Adding a function

Add a function to the Actions field of a managed topic in three ways:
  1. Type / in the Actions field
  2. Right-click in the Actions field
  3. Click the + icon on the right side of the field
Select a function from the menu, or create a new one to populate later. You can reuse the same function across multiple topics and actions.
Function references like {"{{fn:order_lookup}}"} are only valid in the Actions field. Placing them in the Content field will not trigger the function, and no error is shown. Always add function references in Actions.
Iterative testing helps get your agent to call functions as expected.

{"{{fn:...}}"} vs {"{{ft:...}}"} syntax

The {"{{fn:...}}"} syntax references global functions, which can be used across topics, flows, and rules. This is different from transition functions ({"{{ft:...}}"} syntax), which are scoped to a single flow. See Transition functions for details on flow-scoped functions.

Known limitation: functions in flows

When a function is referenced inside a flow action, it may not be included in the LLM’s tool definitions. This means the LLM cannot see or call the function. If you encounter this, add the function reference to your agent rules so the LLM is aware of it.

Example prompt

Use this pattern in the Actions field to ensure the agent calls a function before responding:
When the user asks "where is my order," do not respond until you have called {{fn:order_lookup}} with an order number. If you don't have the order number, ask for it first, then call {{fn:order_lookup}}. Use the function's response to answer the caller.
This ensures the agent always invokes the function before responding, and grounds its answer in the function’s output.

Controlling agent behavior after a function call

Functions can return values that control what the agent says or does next — for example, returning an exact utterance for the agent to speak, triggering a handoff, or ending the call with hangup. See Return values for the full reference.

Testing

1

Save and open the test panel

Save your agent and click Play in the header to open the test chat panel.
2

Test the invocation

Ask a test question like “Where is my order?” and observe how the agent handles the interaction.
3

Inspect tool calls

Enable the tool calls toggle in the test panel settings to inspect which functions were called and what parameters were passed. Use this to confirm the function was actually triggered and that the correct arguments were sent — especially when the agent is not behaving as expected.
Last modified on March 24, 2026