Quite familiar with the Mastra API so just leafing through the Tanstack AI docs for a quick comparison ahead of actually using it:
- Mastra is clearly extending ai-sdk and is explicitly compatible with ai-sdk (including useChat), tanstack is replacing it, so bit more of a refactor if you're already on ai-sdk
- I like tanstack's implementation of server vs client side tool implementation, the
.server.clientnotation is interesting. It's a litttttle boilerplate-y to have a separate definition and implementation but I can see why they wanted to do it that way - Their useChat seems good
- Mastra supports conditional tool approval, Tanstack has tool approval as a boolean
- That being said, Tanstack's tool approval flow is way less complicated DX-wise, very nice
- Tanstack supports parallel tool calling, Mastra does not. This is very interesting, because now the LLM will need to decide if it wants multiple tools independently from each other or in sequence. I'd love to see how LLMs actually perform when doing