https://retellai.com/?utm_source=discord&utm_medium=seo logo
info: Received result for tool: agent_swap_XXXXXX ...
# ❓・ai-evy-support
p
@AI Evy info: Received result for tool: agent_swap_XXXXXX Agent Transfer Node Result: {"status":"ASSISTANT HANDOFF SUCCESSFUL. You are a new assistant joining an ongoing conversation and the previous assistant has now exited. Your job is to pick up where the last assistant left off and respond in your own voice. DO NOT repeat the previous assistant's words, DO NOT mention that you just took over, and DO NOT repeat greetings. Address the user's last request immediately.","successful":true,"resolvedAgentVersion":0} error: Error encountered in LLM call: Failed to get response from any LLM provider. triedKeys: [llm-deployment:azure-westus-standard-1:gpt-4.1-mini, llm-deployment:openai-default-us:gpt-4.1-mini, llm-deployment:openai-default:gpt-4.1-mini] errorMsgs: [400 Invalid 'messages[6].tool_calls[0].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_\.-]+$'., 400 Invalid 'messages[6].tool_calls[0].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'., 400 Invalid 'messages[6].tool_calls[0].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'.]
a
Thanks for tagging me @Paco. I'll look through relevant sources and get back to you shortly.
### Answer The error points at the tool name, not the handoff itself. The LLM provider rejected
messages[6].tool_calls[0].function.name
because it doesn't match the pattern
^[a-zA-Z0-9_\.-]+$
(or
^[a-zA-Z0-9_-]+$
on some providers) . Only letters, numbers, underscores, hyphens, and (on some providers) periods are allowed. The handoff itself reported
"successful":true
, and the failure happened on the next LLM call, when the tool call from the transcript was replayed to the model. The likely cause is the name you gave the Agent Transfer tool. The LLM sees the tool under the name you set, so it must be a clean identifier like
transfer_to_appointment_agent
. [(1) ]() The log shows the tool as "agent_swap_XXXXXX Agent Transfer Node". That display label contains spaces, which isn't a valid function name. I can't confirm from the available sources whether that's the name stored in the tool call or just a display label, so check the tool's actual name in your config. To fix it: - Rename the Agent Transfer tool or node to use only letters, numbers, underscores, and hyphens, with no spaces or special characters. - Avoid periods, since one of the providers tried here uses a pattern that doesn't allow them. - If you're building in Conversation Flow, check the name on the [Agent Transfer node](/build/conversation-flow/transfer-agent-node) as well. It has the same behavior, configured as a node. - Re-test in the playground or a web call before going live. If the name is already clean, share the tool's name as configured (in the tool config or the agent's JSON) and I can look further.
​ To learn more, see the sources I considered: [[1] Agent Transfer tool: hand a call to another AI agent](https://docs.retellai.com/build/single-multi-prompt/transfer-agent) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.