AI SDK
Give a model live local events with the AI SDK. thingstodo-ai adds three tools; the model searches in plain words and answers with real times, venues and links.
npm install thingstodo-ai ai zod
import { generateText, isStepCount } from 'ai';
import { thingsToDoTools } from 'thingstodo-ai';
const { text } = await generateText({
model: 'anthropic/claude-opus-5.5',
tools: thingsToDoTools(),
stopWhen: isStepCount(5),
prompt: 'Plan a Saturday in San Francisco: a market in the morning, live music at night.',
});
console.log(text);
It works the same with streamText and agents.
Tools
searchEvents | Plain words, with time and place read out of them. Optional place, near, from, to, categories, limit, offset. Returns events with local times, venue, price and a link, and how the query was read |
getEvent | One event in full, by the id a search returned |
listCoverage | The cities covered and the categories |
Pass one at a time if you like: tools: { searchEvents: searchEvents() }.
Keys
Without a key, 50 calls a day. A free key gives 1,000 a month: set THINGSTODO_API_KEY, or pass it, thingsToDoTools({ apiKey }).
Without the AI SDK
thingstodo is the plain client, and the MCP server works with any MCP client. Source and examples: github.com/thingstodoapi/thingstodo.