https://retellai.com/?utm_source=discord&utm_medium=seo logo
I’m using a PATCH endpoint to update a lead, and I...
# ❓・ai-evy-support
a
@AI Evy I’m using a PATCH endpoint to update a lead, and I only want the AI tool to send fields that the user explicitly provided in the last message (partial updates). Right now the tool call includes all fields, including null values.
a
Thanks for tagging me @AN45. I'll look through relevant sources and get back to you shortly.
### Answer --- The behavior you're describing—where the LLM sends all fields including nulls in a tool call—is controlled by how you define your custom function/tool and how you instruct the LLM in your prompt. The available documentation doesn't provide a built-in Retell AI feature to automatically filter out null or unspecified fields from tool call arguments. Recommended approaches: 1. Prompt Engineering: In your agent's prompt or tool description, explicitly instruct the LLM to only include fields the user mentioned. For example, in your tool's
description
, you could add: "Only include fields the user explicitly provided. Do not include fields with null or empty values." 2. Handle on Your Server: When your custom function endpoint receives the tool call, filter out any null or empty fields before making your PATCH request to your lead system. This is a common pattern when the LLM may send more fields than necessary. 3. Tool Call Strict Mode: You can enable
tool_call_strict_mode
in your Retell LLM configuration, which ensures responses follow your provided JSON Schema more strictly. [(1) ]() I don't have documentation showing a native Retell AI setting that automatically omits null fields from tool call arguments. If you'd like, I can try to provide a general answer on how to structure your tool description or server-side logic to handle this. Check out these potentially useful sources: - [Update Retell LLM]() - [LLM WebSocket]() - [Update Conversation Flow]()
​ To learn more, see the sources I considered: [[1] Update Retell LLM](https://docs.retellai.com/api-references/update-retell-llm) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Appreciate the feedback! Feel free to ask me again with additional guidance or context.