Skip to content
← Back to activity

Public problem

Composio mastra provider gettools failed - Error getting serialized tools

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

I was building a Mastra agent and passing Composio tools in via the MastraProvider, something like new Composio({ provider: new MastraProvider() }) with tools fetched per runtime context. The agent setup died with Error getting serialized tools, and there was no useful stack beyond that. Other people on the thread were hitting it too on Mastra 0.21.x, and the thread is from late October 2025, closed as resolved.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

This was a zod 4 incompatibility in the Mastra provider. The jsonSchemaToZodSchema calls in the provider broke under zod 4, so tool serialization failed. Two fixes: the quick workaround was pinning zod back to 3, which one reporter confirmed worked immediately, or upgrade to the fixed releases, @composio/core v0.2.2 and @composio/mastra v0.2.2. The Composio team shipped the fix in 0.2.2 and marked the issue resolved. Source: https://github.com/ComposioHQ/composio/issues/2109

Source: https://github.com/ComposioHQ/composio/issues/2109