My fucntion toolcalls are failing but the place it...
# ask-ai
b
My fucntion toolcalls are failing but the place its calling to isnt even recieving the toolcall how do I debug whats the issue {"createdAt":"2026-04-20T110310.714Z","functionToolsExecuted":{"functionCalls":[{"id":"","callId":"item_818b0ee3-12c/fnc_0","arguments":"{\"notes\":\"Lead requested a callback regarding their trademark filing. No specific questions provided—just want to speak to a specialist.\",\"orderId\":\"c1682f68-1e2f-48e0-82f1-695c70a49c7c\",\"phone\":null}","name":"requestCallback"}],"functionCallOutputs":[{"id":"","name":"","callId":"item_818b0ee3-12c/fnc_0","output":"An internal error occurred","isError":true}]}}
✅ 1
t
Thanks for reaching out, Ishan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m sorry you’re running into this. I’ll help you debug why the function tool call shows "An internal error occurred" while the destination never receives the request. Quick clarifying questions (these will let me give targeted steps): • Which Agent SDK and version are you running (Python or Node.js and exact version)? • Are you running the agent locally, self-hosted, or on LiveKit Cloud? • Do you have agent/worker logs around the failure time (server stdout or Agent Console)? If so, paste the error lines or upload them. • Does this failure happen every time for that
requestCallback
call or intermittently? Any recent code or config changes? Immediate debugging steps to try now: 1. Enable the Agent Console (if not already) and reproduce the failure to see real‑time tool execution and errors. 2. Check agent logs for stack traces and messages like “uploading session report to LiveKit Cloud” or crashes before shutdown — missing observability often means the agent crashed before logs uploaded. 3. Confirm your Agent SDK meets minimum debugging versions (Python >= 1.5.2 or Node >= 1.2.4). 4. Add defensive error handling in the tool implementation: catch exceptions, log full stack traces, and return a structured
ToolError
so the agent returns a helpful error instead of crashing. 5. Verify external API/network calls inside the tool: ◦ Ensure timeouts are set and credentials are read from environment variables. ◦ Add request/response logging (without secrets) to confirm the outbound request is actually attempted. 1. If possible, create a mock tool or unit test that simulates the external call to reproduce the error locally without hitting the real destination. If you can, please share: • The SDK version, where the agent runs, and the relevant log excerpt showing the internal error or crash. • The tool implementation snippet (the function that executes
requestCallback
) with any sensitive info redacted. With that info I’ll point to the exact log lines to inspect and the next code changes to capture the root cause. Sources: The ReAct Pattern for Voice Agents and How AI Agents Think, Act, and Respon... | Function tool definition | LiveKit Documentation | Why is my Agent insights data missing? | LiveKit | Why is my Agent insights data missing? | LiveKit | Agent Console | LiveKit Documentation, with interactive elements