https://linen.dev logo
Version: latest (20260225_03) - "anyOf" in create/...
# 🖥│support-forum
h
When using anthropic models (sonet 4.5/6) and new create/update google calendar event function (v 20260225) - i get errors that the model does not support ZodIntersection
Note - I am using it together with mastra v1:
Copy code
this.composio = new Composio({
      apiKey: process.env.COMPOSIO_API_KEY,
      provider: new SanitizedMastraProvider(),
      toolkitVersions: {
        googlecalendar: '20260223_00' // had to do this as otherwise everything breaks
      }
    })
u
Hey @honk, could you provide more context about
SanitizedMastraProvider()
, could you specify any changes made to the provider if any?
h
Hey there, it actually was just normal MastraProvider + some console logs, I've copied mastra provider from the composio source code repo and added logs
Which are not supported by anthropic/ai-sdk it seems
u
Got it, we are checking this.
h
Thanks
Okay, this has actually been damaging for your business. I think we'd be churning as a client and moving to pipedeam/nango
u
Hey @honk, Really sorry for the delay. I understand that it is frustrating. Our team was low on bandwidth, so I hope you understand. We were unable to reproduce the issue on our end. Could you share the SDK version you are using? We are on
0.6.3
.  Here's a snippet for your ref:
Copy code
import { Composio } from '@composio/core';
import { MastraProvider } from '@composio/mastra';
import { Agent } from '@mastra/core/agent';
import { createAnthropic } from '@ai-sdk/anthropic';

const COMPOSIO_API_KEY = '<api-key>';
const ANTHROPIC_API_KEY = '<api-key>';

const anthropic = createAnthropic({ apiKey: ANTHROPIC_API_KEY });

// Initialize Composio with MastraProvider and toolkit versions
const composio = new Composio({
  apiKey: COMPOSIO_API_KEY,
  provider: new MastraProvider(),
  toolkitVersions: {
    googlecalendar: '20260225_00',
  },
});

// Get tools
const tools = await composio.tools.get('<user-id>', 'GOOGLECALENDAR_CREATE_EVENT');

// Create agent with Anthropic Claude 3 Haiku
const agent = new Agent({
  id: 'calendar-agent',
  name: 'Calendar Agent',
  instructions: 'You are a helpful calendar assistant.',
  model: anthropic('claude-sonnet-4-6'),
  tools: tools,
});

// Run using legacy generate API (for AI SDK v4-style model)
const { text } = await agent.generateLegacy([
  { role: 'user', content: 'Create a online-meeting tomorrow at 2pm for 30 minutes with title <> meeting and attendees uday@composio.dev' },
]);

console.log(text);