Prompt, tool calls and post-processing: Common errors
Solutions for unclear prompts, missing tool calls, wrong conditions and empty variables.
Three areas work together for tool calls:
| Area | Purpose |
|---|---|
| Prompt | Controls how your assistant speaks and which information it asks for |
| Integration condition | Defines when a capability is executed |
| Integration variables | Define which values are taken from the conversation |
Important distinction
The trigger condition of an integration belongs directly in the integration, not in the prompt.
In the prompt, you only define how your assistant leads the conversation, which questions it asks and how it announces an action.
The assistant goes off topic
Possible causes
- The role of the assistant is not clearly defined.
- The prompt contains no topic boundaries.
- The prompt is too long or contradictory.
- General rules and important rules are not separated.
- There is no instruction for questions that do not relate to the business.
Solution
Structure your prompt with clear headings:
## Role
## Tasks
## Conversation flow
## If Then rules
## Important rules
Then define which topics your assistant is allowed to answer.
## Role
You are the virtual receptionist of Example Ltd.
You answer questions about our services, opening hours and appointments.
If a question is not related to our business or our services, politely say that you cannot help with it. Then return to the original request.
Keep the prompt as short as possible. Remove duplicate rules, long explanations and contradictory instructions.
How to test it
Ask your assistant three questions:
- A normal question about your business
- A question about a related topic
- A question that clearly has nothing to do with your business
For the third question, your assistant should politely decline and return to the actual conversation.
A tool call is not triggered
Possible causes
- The trigger condition is only in the prompt.
- The condition in the integration is empty or unclear.
- The integration runs at the wrong time.
- The action is restricted by opening hours.
- A required piece of information is missing.
- The integration is not activated or was not saved.
- The test call does not clearly meet the condition.
Solution
Open the affected integration and first check when it runs:
- Before the call
- During the call
- After the call
For integrations during the call, you will find the trigger condition in the Condition & Description or When should the AI use this? field, depending on the integration.
For integrations after the call, you will find the condition in the Settings tab.
Write a complete and unambiguous sentence there.
Too vague:
On callback.
Better:
Run this integration when the caller explicitly asks for a callback.
Splitting prompt and condition correctly
This belongs in the prompt:
If the caller asks for a callback, ask for their name, their phone number and the reason for the callback.
Then confirm that a team member will get in touch.
This belongs in the integration:
Run this integration when the caller has explicitly asked for a callback.
The prompt collects the information. The condition decides whether the integration is executed.
The tool is only triggered sometimes
Possible causes
- The condition is too vague.
- Callers phrase their request differently than expected.
- Several integrations have similar conditions.
- The required information is not always captured.
- The integration is only active inside or outside opening hours.
Solution
Phrase the condition so that it covers the different ways a caller may express the request.
Too narrow:
Run the integration when the caller says: I would like a callback.
This condition can fail if the caller uses a different sentence.
Better:
Run the integration when the caller explicitly asks for a callback or requests to be contacted later by a team member.
Also check whether several integrations react to the same request. Each integration should have a clearly defined purpose.
How to test it
Make at least three test calls:
- Use exactly the wording from the condition.
- Express the same request in other words.
- Have a conversation in which the condition is not met.
The integration should run on the first two calls and not on the third.
The tool is triggered too often
Possible causes
- The condition is empty.
- The condition contains very general terms.
- An integration after the call runs on every call.
- Several similar conditions overlap.
Solution
Check whether the condition is empty. For many actions, an empty field means they run on every matching conversation.
Too general:
Run the integration when the caller has a question.
Almost every conversation meets this condition.
Better:
Only run the integration when the caller reports a technical problem that could not be solved during the call.
Use words like only, explicitly and after when they make the condition clearer.
Only run the integration after the caller has explicitly agreed to book an appointment.
Post-processing is not executed
This applies, for example, to emails, SMS, Slack messages, HTTP requests and entries in Google Sheets.
Possible causes
- The integration runs during the call instead of after it.
- The condition was not met.
- The integration is restricted by opening hours.
- A required variable is empty.
- The recipient or endpoint is missing.
- The integration was not saved.
- The call has not fully ended yet.
Solution
Open the integration and check:
- Is After the call selected as the execution time?
- Is availability set correctly?
- Is the condition unambiguous?
- Are all recipients, URLs or targets entered?
- Do custom variables have a type and a description?
- Was the integration saved and activated?
Then open the affected call in the call history. Check there whether the action was triggered and which variables were captured.
Tip
Leave the condition empty for a single test. If post-processing then runs, the problem is probably the original condition.
After the test, enter a suitable condition again so the action does not run after every call.
Variable extraction is missing under Technical
Cause
Variable extraction is no longer set up centrally in the Technical section.
Variables are defined directly in the integration where they are needed.
This applies, for example, to:
- Send email
- Send SMS
- HTTP Request
- Google Sheets
- Slack
Solution
Open the affected integration and insert the variable you need into the content, the URL or the body.
{{customer_name}}
Then set a type and a description for the variable.
Type:
String
Description:
The full name of the caller.
The usual options are:
- String
- Number
- Boolean
Description required
Without a precise description, your assistant does not know which value it should capture. For many integrations, the save button therefore stays disabled as long as a description is missing.
The tool runs, but the data is wrong or empty
Possible causes
- The variable was not defined.
- The description is too vague.
- The value was not mentioned in the conversation.
- A system variable was unnecessarily extracted from the conversation.
- The variable name is misspelled.
- The data type does not match the expected value.
- The integration runs too early.
Solution
Distinguish between system values and information from the conversation.
System values
fonio already knows system values. Insert them via Add variable.
Examples:
{{personNumber}}
{{conversationLink}}
{{conversationId}}
{{startTimestamp}}
Use {{personNumber}} for the caller's phone number. Your assistant does not need to ask for it again or derive it from the conversation.
Custom variables
Custom variables are captured from the conversation.
{{order_number}}
Give them a specific description:
The order number the caller gives. It starts with BP followed by eight digits.
Also check the data type. An order number containing letters must be saved as String, not as Number.
How to test it
- Say the value clearly in the test call.
- Open the call in the call history.
- Check which value was saved for the variable.
- Then check which value was passed to the integration.
Only the variable name appears in the content
Instead of a value, you see something like:
{{customer_name}}
Possible causes
- The variable was typed in manually.
- The name does not match the variable definition.
- The variable was not filled.
- The value was not yet available when the integration ran.
Solution
Always insert variables via Add variable.
Then compare the spelling:
{{customer_name}}
is not the same as:
{{customers_name}}
If a variable should contain information from the entire conversation, run the integration after the call.
The assistant treats examples as real information
Cause
The assistant can understand an example sentence as a real instruction or as real business information.
This happens especially often with real names, phone numbers, prices and addresses.
Solution
Use clearly recognizable placeholders in examples.
Wrong:
If Mr. Smith calls, forward to 030 123456.
Better:
If [employee name] calls, forward to [forwarding target].
Wrong:
The initial consultation costs 149 euros.
if this amount is only meant as an example.
Better:
The initial consultation costs [current price from the knowledge base].
Real details do not belong in examples
Do not use real names, phone numbers, addresses or prices as placeholders. Store real business information in the knowledge base or directly in the matching integration.
The wrong integration is executed
Possible causes
- Several integrations have similar names.
- The conditions overlap.
- The prompt mentions an old integration name.
- Two actions react to the same request.
Solution
Give each integration a unique name.
Too similar:
Support
Support email
Support message
Better:
Send technical problem to support
Send callback request to customer service
Report urgent request in Slack
Then write a separate condition for each integration.
Send an email to support when the caller reports a technical problem that was not solved.
Send a Slack message when the caller says that the technical problem is urgent and must be handled immediately.
The problem persists
If an integration still does not run or runs incorrectly, send us:
- The name of the assistant
- The name of the integration
- The execution time
- The complete condition
- The defined variables and descriptions
- Date and time of the test call
- The link to the conversation
- The expected behavior
- The actual behavior
- A screenshot of the integration
You will find a template under How to report a technical problem.
