b24_calendar_list
Retrieve calendar events filtered by date for personal, group, or company calendars.
Instructions
Lista eventos de calendario personal, de grupo o de empresa con filtro de fechas.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Tipo de calendario: user (personal), group (grupo de trabajo), company_calendar (empresa) | user |
| owner_id | No | ID del usuario o grupo propietario. Default: usuario del webhook | |
| from | No | Fecha inicio ISO8601. Ejemplo: "2026-01-01" | |
| to | No | Fecha fin ISO8601. Ejemplo: "2026-12-31" | |
| webhook_url | No |
Implementation Reference
- src/tools/calendar.js:17-28 (handler)Handler function that executes the b24_calendar_list tool logic. Calls Bitrix24 calendar.event.get API with type, ownerId, from, to parameters.
export async function calendarList({ type = 'user', owner_id, from, to, webhook_url }) { const client = new Bitrix24Client(resolveWebhook(webhook_url)); const params = { type, ...(owner_id ? { ownerId: owner_id } : {}), ...(from ? { from } : {}), ...(to ? { to } : {}), }; const res = await client.call('calendar.event.get', params); const events = res.result ?? []; return { portal: client.portal, type, count: events.length, events }; } - src/tools/calendar.js:7-15 (schema)Zod schema defining input parameters: type (enum user/group/company_calendar), owner_id, from, to, webhook_url.
export const calendarListSchema = z.object({ type: z.enum(['user', 'group', 'company_calendar']).optional().default('user').describe( 'Tipo de calendario: user (personal), group (grupo de trabajo), company_calendar (empresa)' ), owner_id: z.union([z.string(), z.number()]).optional().describe('ID del usuario o grupo propietario. Default: usuario del webhook'), from: z.string().optional().describe('Fecha inicio ISO8601. Ejemplo: "2026-01-01"'), to: z.string().optional().describe('Fecha fin ISO8601. Ejemplo: "2026-12-31"'), webhook_url: z.string().url().optional(), }); - index.js:222-224 (registration)Registration of the tool named 'b24_calendar_list' with description, schema, and handler via server.tool().
server.tool('b24_calendar_list', 'Lista eventos de calendario personal, de grupo o de empresa con filtro de fechas.', calendarListSchema.shape, wrap(calendarList)); - src/tools/calendar.js:1-3 (helper)Imports for Zod, Bitrix24Client, and resolveWebhook helper used in the tool.
import { z } from 'zod'; import { Bitrix24Client } from '../bitrix24/client.js'; import { resolveWebhook } from '../utils/resolve-webhook.js';