-
-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathtools.ts
310 lines (300 loc) · 9.91 KB
/
tools.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
import { type Tool } from "@modelcontextprotocol/sdk/types.js";
const CONTACTS_TOOL: Tool = {
name: "contacts",
description: "Search and retrieve contacts from Apple Contacts app",
inputSchema: {
type: "object",
properties: {
name: {
type: "string",
description: "Name to search for (optional - if not provided, returns all contacts). Can be partial name to search."
}
}
}
};
const NOTES_TOOL: Tool = {
name: "notes",
description: "Search, retrieve and create notes in Apple Notes app",
inputSchema: {
type: "object",
properties: {
operation: {
type: "string",
description: "Operation to perform: 'search', 'list', or 'create'",
enum: ["search", "list", "create"]
},
searchText: {
type: "string",
description: "Text to search for in notes (required for search operation)"
},
title: {
type: "string",
description: "Title of the note to create (required for create operation)"
},
body: {
type: "string",
description: "Content of the note to create (required for create operation)"
},
folderName: {
type: "string",
description: "Name of the folder to create the note in (optional for create operation, defaults to 'Claude')"
}
},
required: ["operation"]
}
};
const MESSAGES_TOOL: Tool = {
name: "messages",
description: "Interact with Apple Messages app - send, read, schedule messages and check unread messages",
inputSchema: {
type: "object",
properties: {
operation: {
type: "string",
description: "Operation to perform: 'send', 'read', 'schedule', or 'unread'",
enum: ["send", "read", "schedule", "unread"]
},
phoneNumber: {
type: "string",
description: "Phone number to send message to (required for send, read, and schedule operations)"
},
message: {
type: "string",
description: "Message to send (required for send and schedule operations)"
},
limit: {
type: "number",
description: "Number of messages to read (optional, for read and unread operations)"
},
scheduledTime: {
type: "string",
description: "ISO string of when to send the message (required for schedule operation)"
}
},
required: ["operation"]
}
};
const MAIL_TOOL: Tool = {
name: "mail",
description: "Interact with Apple Mail app - read unread emails, search emails, and send emails",
inputSchema: {
type: "object",
properties: {
operation: {
type: "string",
description: "Operation to perform: 'unread', 'search', 'send', 'mailboxes', or 'accounts'",
enum: ["unread", "search", "send", "mailboxes", "accounts"]
},
account: {
type: "string",
description: "Email account to use (optional - if not provided, searches across all accounts)"
},
mailbox: {
type: "string",
description: "Mailbox to use (optional - if not provided, uses inbox or searches across all mailboxes)"
},
limit: {
type: "number",
description: "Number of emails to retrieve (optional, for unread and search operations)"
},
searchTerm: {
type: "string",
description: "Text to search for in emails (required for search operation)"
},
to: {
type: "string",
description: "Recipient email address (required for send operation)"
},
subject: {
type: "string",
description: "Email subject (required for send operation)"
},
body: {
type: "string",
description: "Email body content (required for send operation)"
},
cc: {
type: "string",
description: "CC email address (optional for send operation)"
},
bcc: {
type: "string",
description: "BCC email address (optional for send operation)"
}
},
required: ["operation"]
}
};
const REMINDERS_TOOL: Tool = {
name: "reminders",
description: "Search, create, and open reminders in Apple Reminders app",
inputSchema: {
type: "object",
properties: {
operation: {
type: "string",
description: "Operation to perform: 'list', 'search', 'open', 'create', or 'listById'",
enum: ["list", "search", "open", "create", "listById"]
},
searchText: {
type: "string",
description: "Text to search for in reminders (required for search and open operations)"
},
name: {
type: "string",
description: "Name of the reminder to create (required for create operation)"
},
listName: {
type: "string",
description: "Name of the list to create the reminder in (optional for create operation)"
},
listId: {
type: "string",
description: "ID of the list to get reminders from (required for listById operation)"
},
props: {
type: "array",
items: {
type: "string"
},
description: "Properties to include in the reminders (optional for listById operation)"
},
notes: {
type: "string",
description: "Additional notes for the reminder (optional for create operation)"
},
dueDate: {
type: "string",
description: "Due date for the reminder in ISO format (optional for create operation)"
}
},
required: ["operation"]
}
};
const WEB_SEARCH_TOOL: Tool = {
name: "webSearch",
description: "Search the web using DuckDuckGo and retrieve content from search results",
inputSchema: {
type: "object",
properties: {
query: {
type: "string",
description: "Search query to look up"
}
},
required: ["query"]
}
};
const CALENDAR_TOOL: Tool = {
name: "calendar",
description: "Search, create, and open calendar events in Apple Calendar app",
inputSchema: {
type: "object",
properties: {
operation: {
type: "string",
description: "Operation to perform: 'search', 'open', 'list', or 'create'",
enum: ["search", "open", "list", "create"]
},
searchText: {
type: "string",
description: "Text to search for in event titles, locations, and notes (required for search operation)"
},
eventId: {
type: "string",
description: "ID of the event to open (required for open operation)"
},
limit: {
type: "number",
description: "Number of events to retrieve (optional, default 10)"
},
fromDate: {
type: "string",
description: "Start date for search range in ISO format (optional, default is today)"
},
toDate: {
type: "string",
description: "End date for search range in ISO format (optional, default is 30 days from now for search, 7 days for list)"
},
title: {
type: "string",
description: "Title of the event to create (required for create operation)"
},
startDate: {
type: "string",
description: "Start date/time of the event in ISO format (required for create operation)"
},
endDate: {
type: "string",
description: "End date/time of the event in ISO format (required for create operation)"
},
location: {
type: "string",
description: "Location of the event (optional for create operation)"
},
notes: {
type: "string",
description: "Additional notes for the event (optional for create operation)"
},
isAllDay: {
type: "boolean",
description: "Whether the event is an all-day event (optional for create operation, default is false)"
},
calendarName: {
type: "string",
description: "Name of the calendar to create the event in (optional for create operation, uses default calendar if not specified)"
}
},
required: ["operation"]
}
};
const MAPS_TOOL: Tool = {
name: "maps",
description: "Search locations, manage guides, save favorites, and get directions using Apple Maps",
inputSchema: {
type: "object",
properties: {
operation: {
type: "string",
description: "Operation to perform with Maps",
enum: ["search", "save", "directions", "pin", "listGuides", "addToGuide", "createGuide"]
},
query: {
type: "string",
description: "Search query for locations (required for search)"
},
limit: {
type: "number",
description: "Maximum number of results to return (optional for search)"
},
name: {
type: "string",
description: "Name of the location (required for save and pin)"
},
address: {
type: "string",
description: "Address of the location (required for save, pin, addToGuide)"
},
fromAddress: {
type: "string",
description: "Starting address for directions (required for directions)"
},
toAddress: {
type: "string",
description: "Destination address for directions (required for directions)"
},
transportType: {
type: "string",
description: "Type of transport to use (optional for directions)",
enum: ["driving", "walking", "transit"]
},
guideName: {
type: "string",
description: "Name of the guide (required for createGuide and addToGuide)"
}
},
required: ["operation"]
}
};
const tools = [CONTACTS_TOOL, NOTES_TOOL, MESSAGES_TOOL, MAIL_TOOL, REMINDERS_TOOL, WEB_SEARCH_TOOL, CALENDAR_TOOL, MAPS_TOOL];
export default tools;