Prompt variables and tool references
Use $ to insert variables (like the contact's name) and ! to reference actions inside your agent's instructions.
Watch this step in the video · Instructions: the editor
Your agent's instructions don't have to be static text. In the Instructions editor you can insert variables that fill themselves in with contact data, and reference the actions (tools) your agent can run.
The two editor shortcuts
In the Instructions tab, while you write the prompt:
- Type
$to insert a variable (for example, the contact's name). - Type
!to insert a reference to an action (one of the agent's tools).
As soon as you type either character, an autocomplete pops up with the available options. Pick one and it becomes a "pill" inside your text.
Most-used variables
Variables are grouped by source. Some common ones:
$contact.first_name— Contact's first name$contact.last_name— Last name$contact.email— Email$contact.phone— Phone$contact.language— Contact's language$workspace.name— Workspace name$conversation.channel_type— Channel type
At runtime, $contact.first_name is replaced with the person's real name. If the field is empty, the agent simply skips it.
How to insert a variable
- Open the agent and go to the Instructions tab.
- Place your cursor where you want the data.
- Type
$and start typing (e.g.name). - Pick the variable from the list (e.g. First name).
- Save your changes.
Example: Greet the customer by name: $contact.first_name.
How to reference an action
Actions are the tools you already set up in the Custom actions tab (book an appointment, tag a contact, create a deal, etc.).
- In the Instructions editor, type
!. - Pick the action from the autocomplete.
- Explain when to use it: "If the customer wants a visit, use !book_appointment".
Referencing an action does not run it — it tells the agent that the tool exists and when it makes sense to use it.
Verify it works
- Open the Sandbox tab.
- Send a message that triggers the data or the action.
- Check the Trace: it shows the real values that were injected and which tool the agent called.
If it doesn't work
- The variable comes out empty: that contact has no value for that field; test with a complete contact.
- No autocomplete appears: make sure you type
$or!as the first character of the token, with no space before it. - The action doesn't run: confirm it's created and active under Custom actions; if you deleted or renamed it, the reference in the prompt breaks.
Tips
- Personalizing with
$contact.first_namedramatically raises the "human touch" feeling. - Don't overload actions: reference only the ones the agent truly needs for that conversation.
Related articles
Related articles
-
Create your first AI agent
Learn what an AI agent does in Omnifox, how to give it instructions, connect it to a channel and test it in the sandbox before it talks to real customers.
-
How to write good instructions for your AI agent
Learn how to write clear instructions so your AI agent replies with the right tone, limits and actions.
-
AI Agents complete guide
AI Agents in depth, in 65 chapters: creating, instructions, tools, knowledge, behavior, tester, inbox, workflows, analytics and usage, with every setting explained.
-
Connect your AI agent to WhatsApp, Instagram, Messenger and web chat
An agent with no channels serves nobody. Connect it to your WhatsApp, Instagram, Messenger or website chat from the Connections section, then switch it on so it starts replying.
-
Start here: AI Agents in 8 minutes
AI Agents essentials in a short video: creating an agent, its instructions, tools, knowledge, channels, the tester, hours and handing over to a person.