getEvents
Fetch meetings and events within a specific date range using Date Math syntax. Retrieve calendar details for queries like 'what meetings next week?' or 'show calendar for tomorrow.' Supports intervals in days, weeks, months, years, hours, minutes, and seconds.
Instructions
Use this tool ONLY to fetch meetings/events in a date range (e.g. "what meetings next week?", "show calendar for tomorrow"). DO NOT use for counting meetings, analyzing patterns, or finding frequent participants.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | Yes | Use Date Math with now +/- time intervals. Supported units: d (days), w (weeks), M (months), y (years), h (hours), m (minutes), s (seconds). Examples: now-1d (yesterday), now+2w (2 weeks ahead), now/M (start of month), now+1M/M (start of next month). | |
| start | Yes | Use Date Math with now +/- time intervals. Supported units: d (days), w (weeks), M (months), y (years), h (hours), m (minutes), s (seconds). Examples: now-1d (yesterday), now+2w (2 weeks ahead), now/M (start of month), now+1M/M (start of next month). |
Implementation Reference
- index.js:320-337 (registration)Registration of the 'getEvents' tool using server.addTool, defining name, description, input schema, and execute handler that proxies to backend.server.addTool({ name: "getEvents", description: 'Use this tool ONLY to fetch meetings/events in a date range (e.g. "what meetings next week?", "show calendar for tomorrow"). DO NOT use for counting meetings, analyzing patterns, or finding frequent participants.', parameters: z.object({ start: z .string() .describe( "Use Date Math with now +/- time intervals. Supported units: d (days), w (weeks), M (months), y (years), h (hours), m (minutes), s (seconds). Examples: now-1d (yesterday), now+2w (2 weeks ahead), now/M (start of month), now+1M/M (start of next month)." ), end: z .string() .describe( "Use Date Math with now +/- time intervals. Supported units: d (days), w (weeks), M (months), y (years), h (hours), m (minutes), s (seconds). Examples: now-1d (yesterday), now+2w (2 weeks ahead), now/M (start of month), now+1M/M (start of next month)." ), }), execute: async (params, { session }) => callTool("/moments/events", params, session), });
- index.js:324-335 (schema)Zod input schema for 'getEvents' tool, defining 'start' and 'end' string parameters using date math notation.parameters: z.object({ start: z .string() .describe( "Use Date Math with now +/- time intervals. Supported units: d (days), w (weeks), M (months), y (years), h (hours), m (minutes), s (seconds). Examples: now-1d (yesterday), now+2w (2 weeks ahead), now/M (start of month), now+1M/M (start of next month)." ), end: z .string() .describe( "Use Date Math with now +/- time intervals. Supported units: d (days), w (weeks), M (months), y (years), h (hours), m (minutes), s (seconds). Examples: now-1d (yesterday), now+2w (2 weeks ahead), now/M (start of month), now+1M/M (start of next month)." ), }),
- index.js:336-337 (handler)Execute handler for 'getEvents' that forwards parameters to the backend endpoint '/moments/events' using the shared callTool function.execute: async (params, { session }) => callTool("/moments/events", params, session), });
- index.js:31-41 (helper)Shared helper function used by multiple tools, including getEvents, to make authenticated POST requests to Clay's backend API.async function callTool(path, params, session) { console.log('Calling tool', path, session) return fetch(`https://nexum.clay.earth/tools${path}`, { body: JSON.stringify(params), headers: { Authorization: `ApiKey ${session.apiKey}`, "Content-Type": "application/json", }, method: "POST", }).then((res) => res.text()); }