Skip to content

Mastra

Use Chronary’s calendar tools in Mastra. new ChronaryToolkit(...).getTools() returns tools ready to pass to a Mastra Agent.

Terminal window
npm install @chronary/toolkit @chronary/sdk @mastra/core
# plus a model provider, e.g. @ai-sdk/openai
npm install @ai-sdk/openai
import { Agent } from '@mastra/core/agent';
import { openai } from '@ai-sdk/openai';
import { ChronaryToolkit } from '@chronary/toolkit/mastra';
const tools = new ChronaryToolkit({
apiKey: process.env.CHRONARY_API_KEY!,
}).getTools();
const agent = new Agent({
id: 'scheduler',
name: 'Scheduler',
instructions: 'You manage the user’s calendar: check availability and book meetings.',
model: openai('gpt-4o'),
tools,
});
const res = await agent.generate('Find a 30-min slot with Alex this week and book it.');
console.log(res.text);