How to resume a suspended tool call from useChat (Mastra standalone + AI SDK)
AgentTools
Hi, I have a question about resuming a suspended tool call. Setup: Standalone Mastra server(
http://localhost:4111
http://localhost:4111
), Next.js frontend, AI SDK(
useChat
useChat
hook). All dependencies are on their latest versions.
Current behavior: When a tool requires approval, I receive a message part with
part.type === "data-tool-call-suspended"
part.type === "data-tool-call-suspended"
,
Question: How do I resume the tool call after approval using
useChat
useChat
?
useChat
useChat
exposes
addToolApprovalResponse
addToolApprovalResponse
, but:
* Is this the correct function to call? * Will it actually resume the suspended tool execution on the Mastra server?
TL;DR When the user clicks Approve in the tool confirmation UI, which function should be called to resume the suspended tool call? Any way too do this is cool , even if it just a hack