Configure messages and rejection rules
Two settings shape how a handoff feels to the caller: the tool messages the assistant speaks while the transfer happens, and the rejection conditions that decide whether the handoff proceeds at all.
Tool messages
Configure what the assistant says during each phase of the handoff. Add a messages array to the Handoff tool to control the spoken responses.
Message types
Example configuration
Message properties
request-start
- content (string) — The text the assistant speaks when the handoff begins.
- blocking (boolean, default:
false) — Whentrue, the tool call waits until the message finishes speaking before executing. - conditions (array) — Optional conditions that must match for this message to trigger.
- contents (array) — Multilingual variants of the content. Overrides
contentwhen provided.
request-complete
- content (string) — The text the assistant speaks when the handoff completes.
- role (
"assistant"|"system", default:"assistant") — When"assistant", the content is spoken aloud. When"system", the content is passed as a system message hint to the model. - endCallAfterSpokenEnabled (boolean, default:
false) — Whentrue, the call ends after this message is spoken. - conditions (array) — Optional conditions for triggering this message.
- contents (array) — Multilingual variants.
request-failed
- content (string) — The text the assistant speaks when the handoff fails.
- endCallAfterSpokenEnabled (boolean, default:
false) — Whentrue, the call ends after this message. - conditions (array) — Optional conditions for triggering.
- contents (array) — Multilingual variants.
request-response-delayed
- content (string) — The text the assistant speaks when the handoff is taking longer than expected.
- timingMilliseconds (number, 100-120000) — Milliseconds to wait before triggering this message.
- conditions (array) — Optional conditions for triggering.
- contents (array) — Multilingual variants.
For the full schema, see the API reference.
Rejection plan
Use rejectionPlan to prevent a handoff from executing based on conversation state. When all conditions in the plan match, the tool call is rejected and the rejection message is added to the conversation.
Regex condition
Match against message content using regular expressions:
This rejects the handoff if the user’s most recent message contains “cancel”, “stop”, or “nevermind” (case-insensitive).
Liquid condition
Use Liquid templates for more complex logic. The template must return exactly "true" or "false":
This rejects the handoff if fewer than 3 user messages exist in the conversation. Available Liquid variables include messages (array of recent messages), now (current timestamp), and any assistant variable values.
Group condition
Combine multiple conditions with AND or OR logic:
By default, all top-level conditions in the conditions array use AND logic — all must match for the rejection to trigger. Use a group condition with operator: "OR" to reject when any single condition matches.
For the full schema, see the API reference.