tool output not being sent back to the custom llm ...
# support
f
Hi, hope you are doing well. First of all thank you for all your work, vapi is great. I do have a big issue connecting vapi to my custom-llm, I have created a server that let's vapi send chat completion requests to my agent, and have my agent do stuff and return with a follow up to be spoken to the user. The issue is even thought I send the tool outputs chunks to vapi as well it seems the tool outputs are not being sent back to me on a user follow up. For example if my user asks about my stock, my gets a full list of stock, responds, and then the user ask about something else from the stock, the agent says it has to go get that information again. This is not really neccesary, as it's essentially retriving the same data twice, and the user actually is able to see this. Is there a way to return the tool output to have vapi store it correctly? I also checked the artifcats at the end of the conversation on the end call report and it seems the tool output is not present, it's fully ignored. Call id is: 019c0522-561f-7551-bf2f-fb3c3508b04b
c
Hi Francisco, Thanks for your patience — I wanted to clarify a couple of important points based on what we’re seeing. How tool outputs work in Vapi When using a custom LLM, tool outputs are not automatically persisted and replayed to your LLM on subsequent turns. The recommended pattern is to store any important results inside the conversation using variables, which the assistant can reference later. You can do this using **double curly braces (
{{ }}
)** as placeholders. Example system prompt:
Copy code
When the user asks for inventory information, call the `lookup` tool
and store the result in {{inventory_data}}.

If the user later asks about item quantity or availability,
use the information from {{inventory_data}}.
As a best practice, we recommend storing individual data points (e.g.
{{item_name}}
,
{{item_quantity}}
) rather than large blobs. This gives more predictable behavior across turns. Reference: https://docs.vapi.ai/prompting-guide#example-appointment-setter-prompt Important note about tools on this call For the call you shared (019c0522-561f-7551-bf2f-fb3c3508b04b), the assistant only had **two tools attached at call start**: •
endCall
voicemail
If there is another tool you want the assistant to execute (for example, a stock lookup or database query), it must be attached to the assistant configuration before the call starts. After attaching the tool, you should explicitly describe when and why the assistant should use it in the system prompt, for example:
Copy code
If the user asks about stock or inventory,
call the `lookup` tool and store the result in {{inventory_data}}.
Without attaching the tool ahead of time, the assistant cannot execute it or persist its output. If you’d like, feel free to share: • The list of tools you intend to use • A snippet of your current system prompt We’re happy to help you wire this up cleanly so you avoid repeated tool calls. Best regards, Kyle Vapi Support