caldav-mcp 0.13.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -172,7 +172,7 @@ Parameters:
172
172
 
173
173
  - `calendarUrl`: string
174
174
  - `description`: string (optional)
175
- - `end`: string — End datetime (ISO 8601)
175
+ - `end`: string — End datetime (ISO 8601 with an offset, e.g. 2026-05-01T09:00:00+02:00 or 2026-05-01T07:00:00Z)
176
176
  - `location`: string (optional)
177
177
  - `organizer`: string (optional) — Organizer email (no mailto:), written as ORGANIZER; a scheduling-capable server (e.g. Radicale with the email/iMIP hook) uses it to send invitations, updates and cancellations to the attendees.
178
178
  - `recurrenceRule`: object (optional)
@@ -182,8 +182,8 @@ Parameters:
182
182
  - `count`: number (optional)
183
183
  - `freq`: enum (`DAILY` | `WEEKLY` | `MONTHLY` | `YEARLY`) (optional)
184
184
  - `interval`: number (optional)
185
- - `until`: string (optional)
186
- - `start`: string — Start datetime (ISO 8601)
185
+ - `until`: string (optional) — Last occurrence at or before this datetime (ISO 8601 with an offset, e.g. 2026-05-01T09:00:00+02:00 or 2026-05-01T07:00:00Z)
186
+ - `start`: string — Start datetime (ISO 8601 with an offset, e.g. 2026-05-01T09:00:00+02:00 or 2026-05-01T07:00:00Z)
187
187
  - `attendees`: array of string (optional) — Attendee emails (no mailto:), written as ATTENDEE lines; a scheduling-capable server mails them the invitation. Requires organizer.
188
188
  - `summary`: string
189
189
  - `wholeDay`: boolean (optional) — Create as a whole-day event
@@ -200,7 +200,7 @@ Parameters:
200
200
 
201
201
  - `calendarUrl`: string
202
202
  - `description`: string (optional)
203
- - `end`: string (optional)
203
+ - `end`: string (optional) — New end datetime (ISO 8601 with an offset, e.g. 2026-05-01T09:00:00+02:00 or 2026-05-01T07:00:00Z)
204
204
  - `location`: string (optional)
205
205
  - `organizer`: string (optional) — Organizer email (no mailto:); pass to set or change ORGANIZER, or an empty string to remove it (only when the event has no attendees). Omit to leave it as stored.
206
206
  - `recurrenceRule`: object (optional)
@@ -210,8 +210,8 @@ Parameters:
210
210
  - `count`: number (optional)
211
211
  - `freq`: enum (`DAILY` | `WEEKLY` | `MONTHLY` | `YEARLY`) (optional)
212
212
  - `interval`: number (optional)
213
- - `until`: string (optional)
214
- - `start`: string (optional)
213
+ - `until`: string (optional) — Last occurrence at or before this datetime (ISO 8601 with an offset, e.g. 2026-05-01T09:00:00+02:00 or 2026-05-01T07:00:00Z)
214
+ - `start`: string (optional) — New start datetime (ISO 8601 with an offset, e.g. 2026-05-01T09:00:00+02:00 or 2026-05-01T07:00:00Z)
215
215
  - `attendees`: array of string (optional) — The complete new attendee list (no mailto:): it replaces the stored one, so get the current attendees from list-events and include everyone who should stay. An empty list removes all attendees. Omit to leave them as stored. Requires an organizer.
216
216
  - `summary`: string (optional)
217
217
  - `uid`: string — Unique identifier of the event to update (obtained from list-events)
@@ -241,8 +241,8 @@ List tasks (VTODOs) in the calendar specified by its URL. By default returns onl
241
241
  Parameters:
242
242
 
243
243
  - `calendarUrl`: string
244
- - `due_after`: string (optional) — Only tasks with a due date at or after this (ISO 8601). Undated tasks are excluded when a due window is set.
245
- - `due_before`: string (optional) — Only tasks with a due date at or before this (ISO 8601). Undated tasks are excluded when a due window is set.
244
+ - `due_after`: string (optional) — Only tasks with a due date at or after this; undated tasks are excluded when a due window is set (ISO 8601 with an offset, e.g. 2026-05-01T09:00:00+02:00 or 2026-05-01T07:00:00Z)
245
+ - `due_before`: string (optional) — Only tasks with a due date at or before this; undated tasks are excluded when a due window is set (ISO 8601 with an offset, e.g. 2026-05-01T09:00:00+02:00 or 2026-05-01T07:00:00Z)
246
246
  - `limit`: number (optional) — Max tasks to return (default 50, max 500)
247
247
  - `offset`: number (optional) — Tasks to skip (default 0)
248
248
  - `status`: enum (`OPEN` | `ALL` | `NEEDS-ACTION` | `COMPLETED` | `IN-PROCESS` | `CANCELLED`) (optional) — Filter by status. `OPEN` (default) = NEEDS-ACTION + IN-PROCESS; `ALL` = everything; or an exact status (NEEDS-ACTION, COMPLETED, IN-PROCESS, CANCELLED).
@@ -259,10 +259,10 @@ Parameters:
259
259
 
260
260
  - `calendarUrl`: string
261
261
  - `description`: string (optional)
262
- - `due`: string (optional) — Due datetime (ISO 8601)
262
+ - `due`: string (optional) — Due datetime (ISO 8601 with an offset, e.g. 2026-05-01T09:00:00+02:00 or 2026-05-01T07:00:00Z)
263
263
  - `location`: string (optional)
264
- - `reminderAt`: string (optional) — When the user's devices should notify about the task: a clock time (ISO 8601 with offset), not an offset from the due date. For "an hour before it's due", pass the due time minus one hour.
265
- - `start`: string (optional) — Start datetime (ISO 8601)
264
+ - `reminderAt`: string (optional) — When the user's devices should notify about the task: a clock time, not an offset from the due date. For "an hour before it's due", pass the due time minus one hour (ISO 8601 with an offset, e.g. 2026-05-01T09:00:00+02:00 or 2026-05-01T07:00:00Z)
265
+ - `start`: string (optional) — Start datetime (ISO 8601 with an offset, e.g. 2026-05-01T09:00:00+02:00 or 2026-05-01T07:00:00Z)
266
266
  - `status`: enum (`NEEDS-ACTION` | `COMPLETED` | `IN-PROCESS` | `CANCELLED`) (optional) — Defaults to NEEDS-ACTION when omitted
267
267
  - `summary`: string
268
268
 
@@ -278,10 +278,10 @@ Parameters:
278
278
 
279
279
  - `calendarUrl`: string
280
280
  - `description`: string (optional)
281
- - `due`: string (optional)
281
+ - `due`: string (optional) — New due datetime (ISO 8601 with an offset, e.g. 2026-05-01T09:00:00+02:00 or 2026-05-01T07:00:00Z)
282
282
  - `location`: string (optional)
283
- - `reminderAt`: string | null (optional) — When the user's devices should notify about the task: a clock time (ISO 8601 with offset), not an offset from the due date. For "an hour before it's due", pass the due time minus one hour. Replaces all existing reminders; `null` removes them; omit to keep them.
284
- - `start`: string (optional)
283
+ - `reminderAt`: string | null (optional) — When the user's devices should notify about the task: a clock time, not an offset from the due date. For "an hour before it's due", pass the due time minus one hour. Replaces all existing reminders; `null` removes them; omit to keep them (ISO 8601 with an offset, e.g. 2026-05-01T09:00:00+02:00 or 2026-05-01T07:00:00Z)
284
+ - `start`: string (optional) — New start datetime (ISO 8601 with an offset, e.g. 2026-05-01T09:00:00+02:00 or 2026-05-01T07:00:00Z)
285
285
  - `status`: enum (`NEEDS-ACTION` | `COMPLETED` | `IN-PROCESS` | `CANCELLED`) (optional)
286
286
  - `summary`: string (optional)
287
287
  - `uid`: string — Unique identifier of the todo to update (from list-todos)
@@ -10,13 +10,18 @@ const ADDRESS = new RegExp(`^${ADDRESS_PART}@${ADDRESS_PART}$`, "u");
10
10
  const ADDRESS_OR_EMPTY = new RegExp(`^(?:${ADDRESS_PART}@${ADDRESS_PART})?$`, "u");
11
11
  const MAILTO_PREFIX = /^mailto:/iu;
12
12
  const ADDRESS_MESSAGE = "Expected a plain email address such as name@example.com (no mailto:, no display name)";
13
+ // A `refine`, not `.regex()`: zod emits `.regex()` as a JSON Schema `pattern`,
14
+ // which grammar-constrained clients such as llama.cpp may fail to compile
15
+ // (issue #171). The field descriptions carry the format hint instead.
13
16
  export const emailAddressSchema = z
14
17
  .string()
15
- .regex(ADDRESS, { message: ADDRESS_MESSAGE });
18
+ .refine((value) => ADDRESS.test(value), { message: ADDRESS_MESSAGE });
16
19
  // update-event takes "" to remove the stored organizer.
17
20
  export const emailAddressOrEmptySchema = z
18
21
  .string()
19
- .regex(ADDRESS_OR_EMPTY, { message: ADDRESS_MESSAGE });
22
+ .refine((value) => ADDRESS_OR_EMPTY.test(value), {
23
+ message: ADDRESS_MESSAGE,
24
+ });
20
25
  export function toCalAddress(email) {
21
26
  return `mailto:${email}`;
22
27
  }
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { toCalendarPath } from "./caldav-href.js";
3
3
  import { assertOrganizerForAttendees, emailAddressSchema, toCalAddress, } from "./calendar-address.js";
4
+ import { isoDateTime } from "./iso-datetime.js";
4
5
  import { recurrenceRuleSchema, toRecurrenceRule } from "./recurrence-rule.js";
5
6
  import { toWholeDayDate } from "./whole-day-date.js";
6
7
  export const createEventDefinition = {
@@ -8,19 +9,13 @@ export const createEventDefinition = {
8
9
  inputSchema: {
9
10
  calendarUrl: z.string(),
10
11
  description: z.string().optional(),
11
- end: z
12
- .string()
13
- .datetime({ offset: true })
14
- .describe("End datetime (ISO 8601)"),
12
+ end: isoDateTime("End datetime"),
15
13
  location: z.string().optional(),
16
14
  organizer: emailAddressSchema
17
15
  .optional()
18
16
  .describe("Organizer email (no mailto:), written as ORGANIZER; a scheduling-capable server (e.g. Radicale with the email/iMIP hook) uses it to send invitations, updates and cancellations to the attendees."),
19
17
  recurrenceRule: recurrenceRuleSchema.optional(),
20
- start: z
21
- .string()
22
- .datetime({ offset: true })
23
- .describe("Start datetime (ISO 8601)"),
18
+ start: isoDateTime("Start datetime"),
24
19
  attendees: z
25
20
  .array(emailAddressSchema)
26
21
  .optional()
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { toCalendarPath } from "./caldav-href.js";
3
+ import { isoDateTime } from "./iso-datetime.js";
3
4
  import { reminderAlarm } from "./reminder.js";
4
5
  import { todoStatusSchema } from "./todo-status.js";
5
6
  export const createTodoDefinition = {
@@ -7,22 +8,10 @@ export const createTodoDefinition = {
7
8
  inputSchema: {
8
9
  calendarUrl: z.string(),
9
10
  description: z.string().optional(),
10
- due: z
11
- .string()
12
- .datetime({ offset: true })
13
- .optional()
14
- .describe("Due datetime (ISO 8601)"),
11
+ due: isoDateTime("Due datetime").optional(),
15
12
  location: z.string().optional(),
16
- reminderAt: z
17
- .string()
18
- .datetime({ offset: true })
19
- .optional()
20
- .describe("When the user's devices should notify about the task: a clock time (ISO 8601 with offset), not an offset from the due date. For \"an hour before it's due\", pass the due time minus one hour."),
21
- start: z
22
- .string()
23
- .datetime({ offset: true })
24
- .optional()
25
- .describe("Start datetime (ISO 8601)"),
13
+ reminderAt: isoDateTime("When the user's devices should notify about the task: a clock time, not an offset from the due date. For \"an hour before it's due\", pass the due time minus one hour").optional(),
14
+ start: isoDateTime("Start datetime").optional(),
26
15
  status: todoStatusSchema
27
16
  .optional()
28
17
  .describe("Defaults to NEEDS-ACTION when omitted"),
@@ -0,0 +1,17 @@
1
+ import { z } from "zod";
2
+ const EXAMPLE = "2026-05-01T09:00:00+02:00";
3
+ const strictDateTime = z.iso.datetime({ offset: true });
4
+ /**
5
+ * An ISO 8601 datetime with an offset (`Z` or `±hh:mm`), checked by a
6
+ * `refine` rather than `.datetime()`: zod emits `.datetime()` as a long regex
7
+ * `pattern` in the JSON Schema, which grammar-constrained clients such as
8
+ * llama.cpp fail to compile (issue #171). A `refine` is not exported, so the
9
+ * advertised schema is a plain string and the description is the only format
10
+ * hint.
11
+ */
12
+ export const isoDateTime = (description) => z
13
+ .string()
14
+ .refine((value) => strictDateTime.safeParse(value).success, {
15
+ message: `Invalid datetime, expected ISO 8601 with an offset, e.g. ${EXAMPLE}`,
16
+ })
17
+ .describe(`${description} (ISO 8601 with an offset, e.g. ${EXAMPLE} or 2026-05-01T07:00:00Z)`);
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { toCalendarPath } from "./caldav-href.js";
3
+ import { isoDateTime } from "./iso-datetime.js";
3
4
  import { reminderTimes } from "./reminder.js";
4
5
  import { todoStatusSchema } from "./todo-status.js";
5
6
  // `OPEN`/`ALL` are filter keywords expressing sets no single status can (a union
@@ -38,16 +39,8 @@ export const listTodosDefinition = {
38
39
  description: "List tasks (VTODOs) in the calendar specified by its URL. By default returns only open tasks (NEEDS-ACTION and IN-PROCESS), sorted by manual order then due date. Use `status` to include completed (`COMPLETED`) or all (`ALL`) tasks, and `limit`/`offset` to page through long lists.",
39
40
  inputSchema: {
40
41
  calendarUrl: z.string(),
41
- due_after: z
42
- .string()
43
- .datetime({ offset: true })
44
- .optional()
45
- .describe("Only tasks with a due date at or after this (ISO 8601). Undated tasks are excluded when a due window is set."),
46
- due_before: z
47
- .string()
48
- .datetime({ offset: true })
49
- .optional()
50
- .describe("Only tasks with a due date at or before this (ISO 8601). Undated tasks are excluded when a due window is set."),
42
+ due_after: isoDateTime("Only tasks with a due date at or after this; undated tasks are excluded when a due window is set").optional(),
43
+ due_before: isoDateTime("Only tasks with a due date at or before this; undated tasks are excluded when a due window is set").optional(),
51
44
  limit: z
52
45
  .number()
53
46
  .int()
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { isoDateTime } from "./iso-datetime.js";
2
3
  import { toWholeDayDate } from "./whole-day-date.js";
3
4
  export function toRecurrenceRule(r, wholeDay) {
4
5
  const out = {};
@@ -32,5 +33,5 @@ export const recurrenceRuleSchema = z.object({
32
33
  count: z.number().optional(),
33
34
  freq: z.enum(["DAILY", "WEEKLY", "MONTHLY", "YEARLY"]).optional(),
34
35
  interval: z.number().optional(),
35
- until: z.string().datetime({ offset: true }).optional(), // ISO 8601 string
36
+ until: isoDateTime("Last occurrence at or before this datetime").optional(),
36
37
  });
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { hrefFor, toCalendarPath } from "./caldav-href.js";
3
3
  import { assertOrganizerForAttendees, emailAddressOrEmptySchema, emailAddressSchema, readScheduling, toCalAddress, } from "./calendar-address.js";
4
+ import { isoDateTime } from "./iso-datetime.js";
4
5
  import { recurrenceRuleSchema, toRecurrenceRule } from "./recurrence-rule.js";
5
6
  import { carryOverWholeDayDates, toWholeDayDate } from "./whole-day-date.js";
6
7
  export const updateEventDefinition = {
@@ -8,13 +9,13 @@ export const updateEventDefinition = {
8
9
  inputSchema: {
9
10
  calendarUrl: z.string(),
10
11
  description: z.string().optional(),
11
- end: z.string().datetime({ offset: true }).optional(),
12
+ end: isoDateTime("New end datetime").optional(),
12
13
  location: z.string().optional(),
13
14
  organizer: emailAddressOrEmptySchema
14
15
  .optional()
15
16
  .describe("Organizer email (no mailto:); pass to set or change ORGANIZER, or an empty string to remove it (only when the event has no attendees). Omit to leave it as stored."),
16
17
  recurrenceRule: recurrenceRuleSchema.optional(),
17
- start: z.string().datetime({ offset: true }).optional(),
18
+ start: isoDateTime("New start datetime").optional(),
18
19
  attendees: z
19
20
  .array(emailAddressSchema)
20
21
  .optional()
@@ -1,21 +1,23 @@
1
1
  import { z } from "zod";
2
2
  import { hrefFor, toCalendarPath } from "./caldav-href.js";
3
+ import { isoDateTime } from "./iso-datetime.js";
3
4
  import { updatedAlarms } from "./reminder.js";
4
5
  import { todoStatusSchema } from "./todo-status.js";
6
+ // `.nullable()` wraps the schema, so the description is set again on the
7
+ // wrapper for clients and the generated docs to see it.
8
+ const reminderAtSchema = isoDateTime("When the user's devices should notify about the task: a clock time, not an offset from the due date. For \"an hour before it's due\", pass the due time minus one hour. Replaces all existing reminders; `null` removes them; omit to keep them");
5
9
  export const updateTodoDefinition = {
6
10
  description: "Updates an existing task (VTODO) in the calendar specified by its URL. Only provided fields are changed. `reminderAt` replaces the task's reminders with one at that time, `null` removes all of them, and omitting it keeps them. To mark a task done, prefer the `complete-todo` tool.",
7
11
  inputSchema: {
8
12
  calendarUrl: z.string(),
9
13
  description: z.string().optional(),
10
- due: z.string().datetime({ offset: true }).optional(),
14
+ due: isoDateTime("New due datetime").optional(),
11
15
  location: z.string().optional(),
12
- reminderAt: z
13
- .string()
14
- .datetime({ offset: true })
16
+ reminderAt: reminderAtSchema
15
17
  .nullable()
16
18
  .optional()
17
- .describe("When the user's devices should notify about the task: a clock time (ISO 8601 with offset), not an offset from the due date. For \"an hour before it's due\", pass the due time minus one hour. Replaces all existing reminders; `null` removes them; omit to keep them."),
18
- start: z.string().datetime({ offset: true }).optional(),
19
+ .describe(reminderAtSchema.description ?? ""),
20
+ start: isoDateTime("New start datetime").optional(),
19
21
  status: todoStatusSchema.optional(),
20
22
  summary: z.string().optional(),
21
23
  uid: z
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "caldav-mcp",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "A CalDAV client using Model Context Protocol (MCP) to expose calendar operations as tools for AI assistants.",
5
5
  "homepage": "https://github.com/langmail/caldav-mcp#readme",
6
6
  "bugs": {