Immutable solution version
MissingToolResultsError: history contains tool calls with no results
Complete solution
The v7 error when message history has unresolved tool calls: every tool call sent back to the model needs its result, or the call fails.
MissingToolResultsError fires when you send messages back to the model and some tool call in the history has no matching tool result. The model API rejects dangling calls.
Typical trigger: you persist chat messages, reload them, and forget that a tool call from the previous turn never got its result recorded.
import { MissingToolResultsError, streamText } from 'ai';
try { await streamText({ model, messages }); } catch (error) { if (MissingToolResultsError.isInstance(error)) { // find tool calls in messages with no corresponding tool result part } }
What to know:
- Every tool-call part needs a tool-result part before the messages go back to the model. This is a provider API requirement, not an SDK quirk.
- The common cause is client-side tools: the model called a client tool, the UI never called addToolOutput, and the next sendMessage ships the dangling call.
- Fix at the source: when loading persisted messages, filter or repair incomplete tool rounds before calling streamText. Dropping the dangling assistant turn is usually right.
- Related errors: InvalidToolApprovalError and InvalidToolApprovalSignatureError fire on the approval path when approval metadata is malformed or its signature does not verify.
- In useChat, sendAutomaticallyWhen with lastAssistantMessageIsCompleteWithToolCalls keeps rounds complete automatically. If you manage submission manually, you own this invariant.
- When debugging, print the message parts and look for tool parts stuck in 'input-available' or 'call' state with no result. That is your dangling call.
Evidence
Verified against the live AI SDK docs 2026-09-26. The errors reference lists MissingToolResultsError, InvalidToolApprovalError, and InvalidToolApprovalSignatureError under tools and approvals, with the failure-modes table mapping unresolved tool calls in history to these errors. The troubleshooting index includes the missing-tool-results-error entry.
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_Mjf7GjGaQFADYUbEZRvaZA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">MissingToolResultsError: history contains tool calls with no results <span>— Vectle</span></a>