caldav-mcp 0.7.0 → 0.8.0

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
@@ -70,70 +70,86 @@ node dist/index.js
70
70
 
71
71
  ## Available Tools
72
72
 
73
- ### create-event
73
+ <!-- TOOLS:START - generated by scripts/gen-tool-docs.ts -->
74
+ ### list-calendars
74
75
 
75
- Creates a new calendar event.
76
+ List all calendars returning both name and URL
76
77
 
77
- Parameters:
78
- - `summary`: String - Event title/summary
79
- - `start`: DateTime string - Event start time
80
- - `end`: DateTime string - Event end time
78
+ Parameters: none
81
79
 
82
80
  Returns:
83
- - The unique ID of the created event
81
+ - List of all available calendars
84
82
 
85
83
  ### list-events
86
84
 
87
- Lists events within a specified timeframe.
85
+ List all events between start and end date in the calendar specified by its URL
88
86
 
89
87
  Parameters:
90
- - `start`: DateTime string - Start of the timeframe
91
- - `end`: DateTime string - End of the timeframe
92
- - `calendarUrl`: String - URL of the calendar
88
+ - `start`: string — Start date (ISO 8601)
89
+ - `end`: string — End date (ISO 8601)
90
+ - `calendarUrl`: string
93
91
 
94
92
  Returns:
95
- - A list of events that fall within the given timeframe, each containing:
96
- - `uid`: Unique identifier for the event (required for deletion)
97
- - `summary`: Event title/summary
98
- - `start`: Event start time
99
- - `end`: Event end time
93
+ - A list of events that fall within the given timeframe, each containing `uid`, `summary`, `start`, `end`, and optionally `description` and `location`
100
94
 
101
- ### update-event
95
+ ### create-event
102
96
 
103
- Updates an existing calendar event. Only provided fields are changed.
97
+ Creates an event in the calendar specified by its URL
104
98
 
105
99
  Parameters:
106
- - `uid`: String - Unique identifier of the event to update (obtained from list-events)
107
- - `calendarUrl`: String - URL of the calendar
108
- - `summary`: String (optional) - New event title/summary
109
- - `start`: DateTime string (optional) - New event start time
110
- - `end`: DateTime string (optional) - New event end time
111
- - `description`: String (optional) - New event description
112
- - `location`: String (optional) - New event location
113
- - `recurrenceRule`: Object (optional) - New recurrence rule
100
+ - `summary`: string
101
+ - `start`: string — Start datetime (ISO 8601)
102
+ - `end`: string — End datetime (ISO 8601)
103
+ - `calendarUrl`: string
104
+ - `description`: string (optional)
105
+ - `location`: string (optional)
106
+ - `recurrenceRule`: object (optional)
107
+ - `freq`: enum (`DAILY` | `WEEKLY` | `MONTHLY` | `YEARLY`) (optional)
108
+ - `interval`: number (optional)
109
+ - `count`: number (optional)
110
+ - `until`: string (optional)
111
+ - `byday`: array of string (optional)
112
+ - `bymonthday`: array of number (optional)
113
+ - `bymonth`: array of number (optional)
114
114
 
115
115
  Returns:
116
- - The unique ID of the updated event
116
+ - The unique ID of the created event
117
117
 
118
- ### delete-event
118
+ ### update-event
119
119
 
120
- Deletes an event from the calendar.
120
+ Updates an existing event in the calendar specified by its URL. Only provided fields are changed.
121
121
 
122
122
  Parameters:
123
- - `uid`: String - Unique identifier of the event to delete (obtained from list-events)
124
- - `calendarUrl`: String - URL of the calendar
123
+ - `uid`: string — Unique identifier of the event to update (obtained from list-events)
124
+ - `calendarUrl`: string
125
+ - `summary`: string (optional)
126
+ - `start`: string (optional)
127
+ - `end`: string (optional)
128
+ - `description`: string (optional)
129
+ - `location`: string (optional)
130
+ - `recurrenceRule`: object (optional)
131
+ - `freq`: enum (`DAILY` | `WEEKLY` | `MONTHLY` | `YEARLY`) (optional)
132
+ - `interval`: number (optional)
133
+ - `count`: number (optional)
134
+ - `until`: string (optional)
135
+ - `byday`: array of string (optional)
136
+ - `bymonthday`: array of number (optional)
137
+ - `bymonth`: array of number (optional)
125
138
 
126
139
  Returns:
127
- - Confirmation message when the event is successfully deleted
140
+ - The unique ID of the updated event
128
141
 
129
- ### list-calendars
142
+ ### delete-event
130
143
 
131
- Lists all available calendars.
144
+ Deletes an event in the calendar specified by its URL
132
145
 
133
- Parameters: none
146
+ Parameters:
147
+ - `uid`: string — Unique identifier of the event to delete (obtained from list-events)
148
+ - `calendarUrl`: string
134
149
 
135
150
  Returns:
136
- - List of all available calendars
151
+ - Confirmation message when the event is successfully deleted
152
+ <!-- TOOLS:END -->
137
153
 
138
154
  ## License
139
155
 
@@ -8,24 +8,30 @@ const recurrenceRuleSchema = z.object({
8
8
  bymonthday: z.array(z.number()).optional(),
9
9
  bymonth: z.array(z.number()).optional(),
10
10
  });
11
+ export const createEventDefinition = {
12
+ name: "create-event",
13
+ description: "Creates an event in the calendar specified by its URL",
14
+ inputSchema: {
15
+ summary: z.string(),
16
+ start: z
17
+ .string()
18
+ .datetime({ offset: true })
19
+ .describe("Start datetime (ISO 8601)"),
20
+ end: z
21
+ .string()
22
+ .datetime({ offset: true })
23
+ .describe("End datetime (ISO 8601)"),
24
+ calendarUrl: z.string(),
25
+ description: z.string().optional(),
26
+ location: z.string().optional(),
27
+ recurrenceRule: recurrenceRuleSchema.optional(),
28
+ },
29
+ returns: "The unique ID of the created event",
30
+ };
11
31
  export function registerCreateEvent(client, server) {
12
- server.registerTool("create-event", {
13
- description: "Creates an event in the calendar specified by its URL",
14
- inputSchema: {
15
- summary: z.string(),
16
- start: z
17
- .string()
18
- .datetime({ offset: true })
19
- .describe("Start datetime (ISO 8601)"),
20
- end: z
21
- .string()
22
- .datetime({ offset: true })
23
- .describe("End datetime (ISO 8601)"),
24
- calendarUrl: z.string(),
25
- description: z.string().optional(),
26
- location: z.string().optional(),
27
- recurrenceRule: recurrenceRuleSchema.optional(),
28
- },
32
+ server.registerTool(createEventDefinition.name, {
33
+ description: createEventDefinition.description,
34
+ inputSchema: createEventDefinition.inputSchema,
29
35
  }, async (args) => {
30
36
  const { calendarUrl, summary, start, end, description, location, recurrenceRule, } = args;
31
37
  const event = await client.createEvent(calendarUrl, {
@@ -1,8 +1,19 @@
1
1
  import { z } from "zod";
2
+ export const deleteEventDefinition = {
3
+ name: "delete-event",
4
+ description: "Deletes an event in the calendar specified by its URL",
5
+ inputSchema: {
6
+ uid: z
7
+ .string()
8
+ .describe("Unique identifier of the event to delete (obtained from list-events)"),
9
+ calendarUrl: z.string(),
10
+ },
11
+ returns: "Confirmation message when the event is successfully deleted",
12
+ };
2
13
  export function registerDeleteEvent(client, server) {
3
- server.registerTool("delete-event", {
4
- description: "Deletes an event in the calendar specified by its URL",
5
- inputSchema: { uid: z.string(), calendarUrl: z.string() },
14
+ server.registerTool(deleteEventDefinition.name, {
15
+ description: deleteEventDefinition.description,
16
+ inputSchema: deleteEventDefinition.inputSchema,
6
17
  }, async (args) => {
7
18
  const { uid, calendarUrl } = args;
8
19
  const base = calendarUrl.endsWith("/") ? calendarUrl : `${calendarUrl}/`;
@@ -1,8 +1,14 @@
1
+ export const listCalendarsDefinition = {
2
+ name: "list-calendars",
3
+ description: "List all calendars returning both name and URL",
4
+ inputSchema: {},
5
+ returns: "List of all available calendars",
6
+ };
1
7
  export async function registerListCalendars(client, server) {
2
8
  const calendars = await client.getCalendars();
3
- server.registerTool("list-calendars", {
4
- description: "List all calendars returning both name and URL",
5
- inputSchema: {},
9
+ server.registerTool(listCalendarsDefinition.name, {
10
+ description: listCalendarsDefinition.description,
11
+ inputSchema: listCalendarsDefinition.inputSchema,
6
12
  }, async () => {
7
13
  return { content: [{ type: "text", text: JSON.stringify(calendars) }] };
8
14
  });
@@ -1,22 +1,28 @@
1
1
  import { z } from "zod";
2
+ export const listEventsDefinition = {
3
+ name: "list-events",
4
+ description: "List all events between start and end date in the calendar specified by its URL",
5
+ inputSchema: {
6
+ start: z
7
+ .string()
8
+ .refine((val) => !Number.isNaN(Date.parse(val)), {
9
+ message: "Invalid date string",
10
+ })
11
+ .describe("Start date (ISO 8601)"),
12
+ end: z
13
+ .string()
14
+ .refine((val) => !Number.isNaN(Date.parse(val)), {
15
+ message: "Invalid date string",
16
+ })
17
+ .describe("End date (ISO 8601)"),
18
+ calendarUrl: z.string(),
19
+ },
20
+ returns: "A list of events that fall within the given timeframe, each containing `uid`, `summary`, `start`, `end`, and optionally `description` and `location`",
21
+ };
2
22
  export function registerListEvents(client, server) {
3
- server.registerTool("list-events", {
4
- description: "List all events between start and end date in the calendar specified by its URL",
5
- inputSchema: {
6
- start: z
7
- .string()
8
- .refine((val) => !Number.isNaN(Date.parse(val)), {
9
- message: "Invalid date string",
10
- })
11
- .describe("Start date (ISO 8601)"),
12
- end: z
13
- .string()
14
- .refine((val) => !Number.isNaN(Date.parse(val)), {
15
- message: "Invalid date string",
16
- })
17
- .describe("End date (ISO 8601)"),
18
- calendarUrl: z.string(),
19
- },
23
+ server.registerTool(listEventsDefinition.name, {
24
+ description: listEventsDefinition.description,
25
+ inputSchema: listEventsDefinition.inputSchema,
20
26
  }, async (args) => {
21
27
  const { calendarUrl, start, end } = args;
22
28
  const options = {
@@ -29,6 +35,8 @@ export function registerListEvents(client, server) {
29
35
  summary: e.summary,
30
36
  start: e.start,
31
37
  end: e.end,
38
+ ...(e.description && { description: e.description }),
39
+ ...(e.location && { location: e.location }),
32
40
  }));
33
41
  return {
34
42
  content: [{ type: "text", text: JSON.stringify(data) }],
@@ -8,19 +8,27 @@ const recurrenceRuleSchema = z.object({
8
8
  bymonthday: z.array(z.number()).optional(),
9
9
  bymonth: z.array(z.number()).optional(),
10
10
  });
11
+ export const updateEventDefinition = {
12
+ name: "update-event",
13
+ description: "Updates an existing event in the calendar specified by its URL. Only provided fields are changed.",
14
+ inputSchema: {
15
+ uid: z
16
+ .string()
17
+ .describe("Unique identifier of the event to update (obtained from list-events)"),
18
+ calendarUrl: z.string(),
19
+ summary: z.string().optional(),
20
+ start: z.string().datetime({ offset: true }).optional(),
21
+ end: z.string().datetime({ offset: true }).optional(),
22
+ description: z.string().optional(),
23
+ location: z.string().optional(),
24
+ recurrenceRule: recurrenceRuleSchema.optional(),
25
+ },
26
+ returns: "The unique ID of the updated event",
27
+ };
11
28
  export function registerUpdateEvent(client, server) {
12
- server.registerTool("update-event", {
13
- description: "Updates an existing event in the calendar specified by its URL. Only provided fields are changed.",
14
- inputSchema: {
15
- uid: z.string(),
16
- calendarUrl: z.string(),
17
- summary: z.string().optional(),
18
- start: z.string().datetime({ offset: true }).optional(),
19
- end: z.string().datetime({ offset: true }).optional(),
20
- description: z.string().optional(),
21
- location: z.string().optional(),
22
- recurrenceRule: recurrenceRuleSchema.optional(),
23
- },
29
+ server.registerTool(updateEventDefinition.name, {
30
+ description: updateEventDefinition.description,
31
+ inputSchema: updateEventDefinition.inputSchema,
24
32
  }, async (args) => {
25
33
  const { uid, calendarUrl, summary, start, end, description, location, recurrenceRule, } = args;
26
34
  const base = calendarUrl.endsWith("/") ? calendarUrl : `${calendarUrl}/`;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "caldav-mcp",
3
3
  "description": "A CalDAV client using Model Context Protocol (MCP) to expose calendar operations as tools for AI assistants.",
4
- "version": "0.7.0",
4
+ "version": "0.8.0",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
7
7
  "bin": {
@@ -20,7 +20,9 @@
20
20
  "check": "biome check .",
21
21
  "check:fix": "biome check --write .",
22
22
  "check:ci": "biome ci .",
23
- "validate": "npm run check && npm test && npm run knip && npm run build",
23
+ "docs": "tsx scripts/gen-tool-docs.ts",
24
+ "docs:check": "tsx scripts/gen-tool-docs.ts --check",
25
+ "validate": "npm run check && npm test && npm run knip && npm run docs:check && npm run build",
24
26
  "smoke": "npm run build && tsx --env-file=.env scripts/smoke.ts",
25
27
  "smoke:agent": "npm run build && bash scripts/smoke-agent.sh",
26
28
  "watch": "tsc --watch",