MastraM
Mastra10mo ago
Omicrxn

Unsupported role: tool when using memory

When calling tools on the client and using useChat onToolCall() callback, i return the result, however on my mastra server i get a:
MessageConversionError [AI_MessageConversionError]: Unsupported role: tool

this happens on "@mastra/core": "0.6.1-alpha.0" and "@mastra/core": "0.6.1-alpha.1".

and it only happens while using memory, here is my exact implementation of the memory:
 memory: new Memory({
    storage: new LibSQLStore({
      config: {
        url: process.env.DATABASE_URL ?? 'file:memory.db',
      },
    }),
    options: {
      workingMemory: {
        enabled: true,
        use: "tool-call", // Required for toDataStream() compatibility
      },
    },
  }),


the memory works though
Was this page helpful?