Skip to content

Vercel AI SDK

Use Chronary’s calendar tools directly in the Vercel AI SDK. chronaryTools returns a tools object you pass straight to generateText / streamText. It works with AI SDK 4, 5 and 6: each tool carries its Zod input schema as inputSchema (AI SDK 5 and 6) and as parameters (AI SDK 4).

Terminal window
npm install @chronary/toolkit @chronary/sdk ai
# plus a model provider, e.g. @ai-sdk/openai
npm install @ai-sdk/openai
import { generateText, stepCountIs } from 'ai';
import { openai } from '@ai-sdk/openai';
import { chronaryTools } from '@chronary/toolkit/ai-sdk';
const tools = chronaryTools({
apiKey: process.env.CHRONARY_API_KEY!,
});
const result = await generateText({
model: openai('gpt-4o'),
tools,
stopWhen: stepCountIs(5), // let the model call tools, then answer
prompt: 'Schedule a 30-minute sync with Alex next Tuesday at 10am.',
});
console.log(result.text);

The model can now call any of the 65 Chronary tools (create events, request human calendar setup, check availability, find meeting times, run scheduling proposals, …). See the full list in the MCP Tools Reference.