@mindstone/mcp-server-google-workspace 0.1.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.
Files changed (514) hide show
  1. package/LICENSE +97 -0
  2. package/README.md +71 -0
  3. package/SECURITY.md +38 -0
  4. package/dist/__fixtures__/accounts.d.ts +47 -0
  5. package/dist/__fixtures__/accounts.d.ts.map +1 -0
  6. package/dist/__fixtures__/accounts.js +56 -0
  7. package/dist/__fixtures__/accounts.js.map +1 -0
  8. package/dist/api/handler.d.ts +16 -0
  9. package/dist/api/handler.d.ts.map +1 -0
  10. package/dist/api/handler.js +68 -0
  11. package/dist/api/handler.js.map +1 -0
  12. package/dist/api/request.d.ts +13 -0
  13. package/dist/api/request.d.ts.map +1 -0
  14. package/dist/api/request.js +111 -0
  15. package/dist/api/request.js.map +1 -0
  16. package/dist/api/validators/endpoint.d.ts +8 -0
  17. package/dist/api/validators/endpoint.d.ts.map +1 -0
  18. package/dist/api/validators/endpoint.js +115 -0
  19. package/dist/api/validators/endpoint.js.map +1 -0
  20. package/dist/api/validators/parameter.d.ts +12 -0
  21. package/dist/api/validators/parameter.d.ts.map +1 -0
  22. package/dist/api/validators/parameter.js +155 -0
  23. package/dist/api/validators/parameter.js.map +1 -0
  24. package/dist/index.d.ts +3 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/index.js +28 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/modules/accounts/index.d.ts +12 -0
  29. package/dist/modules/accounts/index.d.ts.map +1 -0
  30. package/dist/modules/accounts/index.js +41 -0
  31. package/dist/modules/accounts/index.js.map +1 -0
  32. package/dist/modules/accounts/manager.d.ts +40 -0
  33. package/dist/modules/accounts/manager.d.ts.map +1 -0
  34. package/dist/modules/accounts/manager.js +359 -0
  35. package/dist/modules/accounts/manager.js.map +1 -0
  36. package/dist/modules/accounts/oauth.d.ts +36 -0
  37. package/dist/modules/accounts/oauth.d.ts.map +1 -0
  38. package/dist/modules/accounts/oauth.js +112 -0
  39. package/dist/modules/accounts/oauth.js.map +1 -0
  40. package/dist/modules/accounts/token.d.ts +32 -0
  41. package/dist/modules/accounts/token.d.ts.map +1 -0
  42. package/dist/modules/accounts/token.js +305 -0
  43. package/dist/modules/accounts/token.js.map +1 -0
  44. package/dist/modules/accounts/types.d.ts +47 -0
  45. package/dist/modules/accounts/types.d.ts.map +1 -0
  46. package/dist/modules/accounts/types.js +16 -0
  47. package/dist/modules/accounts/types.js.map +1 -0
  48. package/dist/modules/accounts/unauthorized.d.ts +3 -0
  49. package/dist/modules/accounts/unauthorized.d.ts.map +1 -0
  50. package/dist/modules/accounts/unauthorized.js +44 -0
  51. package/dist/modules/accounts/unauthorized.js.map +1 -0
  52. package/dist/modules/attachments/cleanup-service.d.ts +44 -0
  53. package/dist/modules/attachments/cleanup-service.d.ts.map +1 -0
  54. package/dist/modules/attachments/cleanup-service.js +118 -0
  55. package/dist/modules/attachments/cleanup-service.js.map +1 -0
  56. package/dist/modules/attachments/index-service.d.ts +57 -0
  57. package/dist/modules/attachments/index-service.d.ts.map +1 -0
  58. package/dist/modules/attachments/index-service.js +110 -0
  59. package/dist/modules/attachments/index-service.js.map +1 -0
  60. package/dist/modules/attachments/response-transformer.d.ts +28 -0
  61. package/dist/modules/attachments/response-transformer.d.ts.map +1 -0
  62. package/dist/modules/attachments/response-transformer.js +64 -0
  63. package/dist/modules/attachments/response-transformer.js.map +1 -0
  64. package/dist/modules/attachments/service.d.ts +47 -0
  65. package/dist/modules/attachments/service.d.ts.map +1 -0
  66. package/dist/modules/attachments/service.js +362 -0
  67. package/dist/modules/attachments/service.js.map +1 -0
  68. package/dist/modules/attachments/transformer.d.ts +28 -0
  69. package/dist/modules/attachments/transformer.d.ts.map +1 -0
  70. package/dist/modules/attachments/transformer.js +31 -0
  71. package/dist/modules/attachments/transformer.js.map +1 -0
  72. package/dist/modules/attachments/types.d.ts +33 -0
  73. package/dist/modules/attachments/types.d.ts.map +1 -0
  74. package/dist/modules/attachments/types.js +9 -0
  75. package/dist/modules/attachments/types.js.map +1 -0
  76. package/dist/modules/calendar/index.d.ts +48 -0
  77. package/dist/modules/calendar/index.d.ts.map +1 -0
  78. package/dist/modules/calendar/index.js +61 -0
  79. package/dist/modules/calendar/index.js.map +1 -0
  80. package/dist/modules/calendar/scopes.d.ts +17 -0
  81. package/dist/modules/calendar/scopes.d.ts.map +1 -0
  82. package/dist/modules/calendar/scopes.js +39 -0
  83. package/dist/modules/calendar/scopes.js.map +1 -0
  84. package/dist/modules/calendar/service.d.ts +75 -0
  85. package/dist/modules/calendar/service.d.ts.map +1 -0
  86. package/dist/modules/calendar/service.js +705 -0
  87. package/dist/modules/calendar/service.js.map +1 -0
  88. package/dist/modules/calendar/types.d.ts +154 -0
  89. package/dist/modules/calendar/types.d.ts.map +1 -0
  90. package/dist/modules/calendar/types.js +11 -0
  91. package/dist/modules/calendar/types.js.map +1 -0
  92. package/dist/modules/comments/index.d.ts +12 -0
  93. package/dist/modules/comments/index.d.ts.map +1 -0
  94. package/dist/modules/comments/index.js +23 -0
  95. package/dist/modules/comments/index.js.map +1 -0
  96. package/dist/modules/comments/service.d.ts +39 -0
  97. package/dist/modules/comments/service.d.ts.map +1 -0
  98. package/dist/modules/comments/service.js +227 -0
  99. package/dist/modules/comments/service.js.map +1 -0
  100. package/dist/modules/comments/types.d.ts +67 -0
  101. package/dist/modules/comments/types.d.ts.map +1 -0
  102. package/dist/modules/comments/types.js +2 -0
  103. package/dist/modules/comments/types.js.map +1 -0
  104. package/dist/modules/contacts/index.d.ts +12 -0
  105. package/dist/modules/contacts/index.d.ts.map +1 -0
  106. package/dist/modules/contacts/index.js +18 -0
  107. package/dist/modules/contacts/index.js.map +1 -0
  108. package/dist/modules/contacts/scopes.d.ts +4 -0
  109. package/dist/modules/contacts/scopes.d.ts.map +1 -0
  110. package/dist/modules/contacts/scopes.js +11 -0
  111. package/dist/modules/contacts/scopes.js.map +1 -0
  112. package/dist/modules/contacts/types.d.ts +55 -0
  113. package/dist/modules/contacts/types.d.ts.map +1 -0
  114. package/dist/modules/contacts/types.js +14 -0
  115. package/dist/modules/contacts/types.js.map +1 -0
  116. package/dist/modules/docs/formatters.d.ts +30 -0
  117. package/dist/modules/docs/formatters.d.ts.map +1 -0
  118. package/dist/modules/docs/formatters.js +76 -0
  119. package/dist/modules/docs/formatters.js.map +1 -0
  120. package/dist/modules/docs/index.d.ts +9 -0
  121. package/dist/modules/docs/index.d.ts.map +1 -0
  122. package/dist/modules/docs/index.js +23 -0
  123. package/dist/modules/docs/index.js.map +1 -0
  124. package/dist/modules/docs/scopes.d.ts +17 -0
  125. package/dist/modules/docs/scopes.d.ts.map +1 -0
  126. package/dist/modules/docs/scopes.js +39 -0
  127. package/dist/modules/docs/scopes.js.map +1 -0
  128. package/dist/modules/docs/service.d.ts +58 -0
  129. package/dist/modules/docs/service.d.ts.map +1 -0
  130. package/dist/modules/docs/service.js +421 -0
  131. package/dist/modules/docs/service.js.map +1 -0
  132. package/dist/modules/docs/types.d.ts +75 -0
  133. package/dist/modules/docs/types.d.ts.map +1 -0
  134. package/dist/modules/docs/types.js +2 -0
  135. package/dist/modules/docs/types.js.map +1 -0
  136. package/dist/modules/drive/index.d.ts +9 -0
  137. package/dist/modules/drive/index.d.ts.map +1 -0
  138. package/dist/modules/drive/index.js +28 -0
  139. package/dist/modules/drive/index.js.map +1 -0
  140. package/dist/modules/drive/scopes.d.ts +19 -0
  141. package/dist/modules/drive/scopes.d.ts.map +1 -0
  142. package/dist/modules/drive/scopes.js +44 -0
  143. package/dist/modules/drive/scopes.js.map +1 -0
  144. package/dist/modules/drive/service.d.ts +33 -0
  145. package/dist/modules/drive/service.d.ts.map +1 -0
  146. package/dist/modules/drive/service.js +467 -0
  147. package/dist/modules/drive/service.js.map +1 -0
  148. package/dist/modules/drive/types.d.ts +55 -0
  149. package/dist/modules/drive/types.d.ts.map +1 -0
  150. package/dist/modules/drive/types.js +2 -0
  151. package/dist/modules/drive/types.js.map +1 -0
  152. package/dist/modules/forms/index.d.ts +13 -0
  153. package/dist/modules/forms/index.d.ts.map +1 -0
  154. package/dist/modules/forms/index.js +24 -0
  155. package/dist/modules/forms/index.js.map +1 -0
  156. package/dist/modules/forms/scopes.d.ts +21 -0
  157. package/dist/modules/forms/scopes.d.ts.map +1 -0
  158. package/dist/modules/forms/scopes.js +36 -0
  159. package/dist/modules/forms/scopes.js.map +1 -0
  160. package/dist/modules/forms/service.d.ts +52 -0
  161. package/dist/modules/forms/service.d.ts.map +1 -0
  162. package/dist/modules/forms/service.js +284 -0
  163. package/dist/modules/forms/service.js.map +1 -0
  164. package/dist/modules/forms/types.d.ts +399 -0
  165. package/dist/modules/forms/types.d.ts.map +1 -0
  166. package/dist/modules/forms/types.js +6 -0
  167. package/dist/modules/forms/types.js.map +1 -0
  168. package/dist/modules/gmail/constants.d.ts +69 -0
  169. package/dist/modules/gmail/constants.d.ts.map +1 -0
  170. package/dist/modules/gmail/constants.js +100 -0
  171. package/dist/modules/gmail/constants.js.map +1 -0
  172. package/dist/modules/gmail/index.d.ts +7 -0
  173. package/dist/modules/gmail/index.d.ts.map +1 -0
  174. package/dist/modules/gmail/index.js +16 -0
  175. package/dist/modules/gmail/index.js.map +1 -0
  176. package/dist/modules/gmail/scopes.d.ts +17 -0
  177. package/dist/modules/gmail/scopes.d.ts.map +1 -0
  178. package/dist/modules/gmail/scopes.js +39 -0
  179. package/dist/modules/gmail/scopes.js.map +1 -0
  180. package/dist/modules/gmail/service.d.ts +2 -0
  181. package/dist/modules/gmail/service.d.ts.map +1 -0
  182. package/dist/modules/gmail/service.js +2 -0
  183. package/dist/modules/gmail/service.js.map +1 -0
  184. package/dist/modules/gmail/services/attachment.d.ts +41 -0
  185. package/dist/modules/gmail/services/attachment.d.ts.map +1 -0
  186. package/dist/modules/gmail/services/attachment.js +143 -0
  187. package/dist/modules/gmail/services/attachment.js.map +1 -0
  188. package/dist/modules/gmail/services/base.d.ts +79 -0
  189. package/dist/modules/gmail/services/base.d.ts.map +1 -0
  190. package/dist/modules/gmail/services/base.js +124 -0
  191. package/dist/modules/gmail/services/base.js.map +1 -0
  192. package/dist/modules/gmail/services/draft.d.ts +104 -0
  193. package/dist/modules/gmail/services/draft.d.ts.map +1 -0
  194. package/dist/modules/gmail/services/draft.js +239 -0
  195. package/dist/modules/gmail/services/draft.js.map +1 -0
  196. package/dist/modules/gmail/services/email.d.ts +82 -0
  197. package/dist/modules/gmail/services/email.d.ts.map +1 -0
  198. package/dist/modules/gmail/services/email.js +462 -0
  199. package/dist/modules/gmail/services/email.js.map +1 -0
  200. package/dist/modules/gmail/services/label.d.ts +62 -0
  201. package/dist/modules/gmail/services/label.d.ts.map +1 -0
  202. package/dist/modules/gmail/services/label.js +501 -0
  203. package/dist/modules/gmail/services/label.js.map +1 -0
  204. package/dist/modules/gmail/services/mime-builder.d.ts +26 -0
  205. package/dist/modules/gmail/services/mime-builder.d.ts.map +1 -0
  206. package/dist/modules/gmail/services/mime-builder.js +83 -0
  207. package/dist/modules/gmail/services/mime-builder.js.map +1 -0
  208. package/dist/modules/gmail/services/search.d.ts +8 -0
  209. package/dist/modules/gmail/services/search.d.ts.map +1 -0
  210. package/dist/modules/gmail/services/search.js +76 -0
  211. package/dist/modules/gmail/services/search.js.map +1 -0
  212. package/dist/modules/gmail/services/settings.d.ts +14 -0
  213. package/dist/modules/gmail/services/settings.d.ts.map +1 -0
  214. package/dist/modules/gmail/services/settings.js +104 -0
  215. package/dist/modules/gmail/services/settings.js.map +1 -0
  216. package/dist/modules/gmail/types.d.ts +279 -0
  217. package/dist/modules/gmail/types.d.ts.map +1 -0
  218. package/dist/modules/gmail/types.js +11 -0
  219. package/dist/modules/gmail/types.js.map +1 -0
  220. package/dist/modules/sheets/a1Utils.d.ts +20 -0
  221. package/dist/modules/sheets/a1Utils.d.ts.map +1 -0
  222. package/dist/modules/sheets/a1Utils.js +252 -0
  223. package/dist/modules/sheets/a1Utils.js.map +1 -0
  224. package/dist/modules/sheets/cellShape.d.ts +48 -0
  225. package/dist/modules/sheets/cellShape.d.ts.map +1 -0
  226. package/dist/modules/sheets/cellShape.js +418 -0
  227. package/dist/modules/sheets/cellShape.js.map +1 -0
  228. package/dist/modules/sheets/errorRewriter.d.ts +6 -0
  229. package/dist/modules/sheets/errorRewriter.d.ts.map +1 -0
  230. package/dist/modules/sheets/errorRewriter.js +120 -0
  231. package/dist/modules/sheets/errorRewriter.js.map +1 -0
  232. package/dist/modules/sheets/formatters.d.ts +54 -0
  233. package/dist/modules/sheets/formatters.d.ts.map +1 -0
  234. package/dist/modules/sheets/formatters.js +270 -0
  235. package/dist/modules/sheets/formatters.js.map +1 -0
  236. package/dist/modules/sheets/index.d.ts +9 -0
  237. package/dist/modules/sheets/index.d.ts.map +1 -0
  238. package/dist/modules/sheets/index.js +23 -0
  239. package/dist/modules/sheets/index.js.map +1 -0
  240. package/dist/modules/sheets/scopes.d.ts +17 -0
  241. package/dist/modules/sheets/scopes.d.ts.map +1 -0
  242. package/dist/modules/sheets/scopes.js +39 -0
  243. package/dist/modules/sheets/scopes.js.map +1 -0
  244. package/dist/modules/sheets/service.d.ts +102 -0
  245. package/dist/modules/sheets/service.d.ts.map +1 -0
  246. package/dist/modules/sheets/service.js +1650 -0
  247. package/dist/modules/sheets/service.js.map +1 -0
  248. package/dist/modules/sheets/types.d.ts +271 -0
  249. package/dist/modules/sheets/types.d.ts.map +1 -0
  250. package/dist/modules/sheets/types.js +2 -0
  251. package/dist/modules/sheets/types.js.map +1 -0
  252. package/dist/modules/sheets/writeGuards.d.ts +31 -0
  253. package/dist/modules/sheets/writeGuards.d.ts.map +1 -0
  254. package/dist/modules/sheets/writeGuards.js +254 -0
  255. package/dist/modules/sheets/writeGuards.js.map +1 -0
  256. package/dist/modules/slides/formatters.d.ts +35 -0
  257. package/dist/modules/slides/formatters.d.ts.map +1 -0
  258. package/dist/modules/slides/formatters.js +96 -0
  259. package/dist/modules/slides/formatters.js.map +1 -0
  260. package/dist/modules/slides/index.d.ts +9 -0
  261. package/dist/modules/slides/index.d.ts.map +1 -0
  262. package/dist/modules/slides/index.js +23 -0
  263. package/dist/modules/slides/index.js.map +1 -0
  264. package/dist/modules/slides/scopes.d.ts +17 -0
  265. package/dist/modules/slides/scopes.d.ts.map +1 -0
  266. package/dist/modules/slides/scopes.js +39 -0
  267. package/dist/modules/slides/scopes.js.map +1 -0
  268. package/dist/modules/slides/service.d.ts +67 -0
  269. package/dist/modules/slides/service.d.ts.map +1 -0
  270. package/dist/modules/slides/service.js +394 -0
  271. package/dist/modules/slides/service.js.map +1 -0
  272. package/dist/modules/slides/types.d.ts +63 -0
  273. package/dist/modules/slides/types.d.ts.map +1 -0
  274. package/dist/modules/slides/types.js +2 -0
  275. package/dist/modules/slides/types.js.map +1 -0
  276. package/dist/modules/tasks/index.d.ts +13 -0
  277. package/dist/modules/tasks/index.d.ts.map +1 -0
  278. package/dist/modules/tasks/index.js +24 -0
  279. package/dist/modules/tasks/index.js.map +1 -0
  280. package/dist/modules/tasks/scopes.d.ts +18 -0
  281. package/dist/modules/tasks/scopes.d.ts.map +1 -0
  282. package/dist/modules/tasks/scopes.js +28 -0
  283. package/dist/modules/tasks/scopes.js.map +1 -0
  284. package/dist/modules/tasks/service.d.ts +72 -0
  285. package/dist/modules/tasks/service.d.ts.map +1 -0
  286. package/dist/modules/tasks/service.js +319 -0
  287. package/dist/modules/tasks/service.js.map +1 -0
  288. package/dist/modules/tasks/types.d.ts +118 -0
  289. package/dist/modules/tasks/types.d.ts.map +1 -0
  290. package/dist/modules/tasks/types.js +6 -0
  291. package/dist/modules/tasks/types.js.map +1 -0
  292. package/dist/modules/tools/registry.d.ts +28 -0
  293. package/dist/modules/tools/registry.d.ts.map +1 -0
  294. package/dist/modules/tools/registry.js +229 -0
  295. package/dist/modules/tools/registry.js.map +1 -0
  296. package/dist/modules/tools/scope-registry.d.ts +31 -0
  297. package/dist/modules/tools/scope-registry.d.ts.map +1 -0
  298. package/dist/modules/tools/scope-registry.js +52 -0
  299. package/dist/modules/tools/scope-registry.js.map +1 -0
  300. package/dist/oauth/client.d.ts +15 -0
  301. package/dist/oauth/client.d.ts.map +1 -0
  302. package/dist/oauth/client.js +136 -0
  303. package/dist/oauth/client.js.map +1 -0
  304. package/dist/resources/compose-email-template.d.ts +2 -0
  305. package/dist/resources/compose-email-template.d.ts.map +1 -0
  306. package/dist/resources/compose-email-template.js +711 -0
  307. package/dist/resources/compose-email-template.js.map +1 -0
  308. package/dist/scripts/health-check.d.ts +3 -0
  309. package/dist/scripts/health-check.d.ts.map +1 -0
  310. package/dist/scripts/health-check.js +22 -0
  311. package/dist/scripts/health-check.js.map +1 -0
  312. package/dist/scripts/setup-environment.d.ts +3 -0
  313. package/dist/scripts/setup-environment.d.ts.map +1 -0
  314. package/dist/scripts/setup-environment.js +91 -0
  315. package/dist/scripts/setup-environment.js.map +1 -0
  316. package/dist/scripts/setup-google-env.d.ts +3 -0
  317. package/dist/scripts/setup-google-env.d.ts.map +1 -0
  318. package/dist/scripts/setup-google-env.js +78 -0
  319. package/dist/scripts/setup-google-env.js.map +1 -0
  320. package/dist/services/base/BaseGoogleService.d.ts +52 -0
  321. package/dist/services/base/BaseGoogleService.d.ts.map +1 -0
  322. package/dist/services/base/BaseGoogleService.js +155 -0
  323. package/dist/services/base/BaseGoogleService.js.map +1 -0
  324. package/dist/services/calendar/index.d.ts +27 -0
  325. package/dist/services/calendar/index.d.ts.map +1 -0
  326. package/dist/services/calendar/index.js +146 -0
  327. package/dist/services/calendar/index.js.map +1 -0
  328. package/dist/services/contacts/index.d.ts +40 -0
  329. package/dist/services/contacts/index.d.ts.map +1 -0
  330. package/dist/services/contacts/index.js +137 -0
  331. package/dist/services/contacts/index.js.map +1 -0
  332. package/dist/services/docs/index.d.ts +4 -0
  333. package/dist/services/docs/index.d.ts.map +1 -0
  334. package/dist/services/docs/index.js +6 -0
  335. package/dist/services/docs/index.js.map +1 -0
  336. package/dist/services/drive/index.d.ts +4 -0
  337. package/dist/services/drive/index.d.ts.map +1 -0
  338. package/dist/services/drive/index.js +6 -0
  339. package/dist/services/drive/index.js.map +1 -0
  340. package/dist/services/gmail/index.d.ts +39 -0
  341. package/dist/services/gmail/index.d.ts.map +1 -0
  342. package/dist/services/gmail/index.js +337 -0
  343. package/dist/services/gmail/index.js.map +1 -0
  344. package/dist/services/sheets/index.d.ts +4 -0
  345. package/dist/services/sheets/index.d.ts.map +1 -0
  346. package/dist/services/sheets/index.js +6 -0
  347. package/dist/services/sheets/index.js.map +1 -0
  348. package/dist/services/slides/index.d.ts +4 -0
  349. package/dist/services/slides/index.d.ts.map +1 -0
  350. package/dist/services/slides/index.js +6 -0
  351. package/dist/services/slides/index.js.map +1 -0
  352. package/dist/tools/account-handlers.d.ts +28 -0
  353. package/dist/tools/account-handlers.d.ts.map +1 -0
  354. package/dist/tools/account-handlers.js +105 -0
  355. package/dist/tools/account-handlers.js.map +1 -0
  356. package/dist/tools/arg-aliases.d.ts +6 -0
  357. package/dist/tools/arg-aliases.d.ts.map +1 -0
  358. package/dist/tools/arg-aliases.js +22 -0
  359. package/dist/tools/arg-aliases.js.map +1 -0
  360. package/dist/tools/calendar-handlers.d.ts +83 -0
  361. package/dist/tools/calendar-handlers.d.ts.map +1 -0
  362. package/dist/tools/calendar-handlers.js +658 -0
  363. package/dist/tools/calendar-handlers.js.map +1 -0
  364. package/dist/tools/comments-handlers.d.ts +59 -0
  365. package/dist/tools/comments-handlers.d.ts.map +1 -0
  366. package/dist/tools/comments-handlers.js +138 -0
  367. package/dist/tools/comments-handlers.js.map +1 -0
  368. package/dist/tools/contacts-handlers.d.ts +36 -0
  369. package/dist/tools/contacts-handlers.d.ts.map +1 -0
  370. package/dist/tools/contacts-handlers.js +128 -0
  371. package/dist/tools/contacts-handlers.js.map +1 -0
  372. package/dist/tools/definitions/account.d.ts +3 -0
  373. package/dist/tools/definitions/account.d.ts.map +1 -0
  374. package/dist/tools/definitions/account.js +77 -0
  375. package/dist/tools/definitions/account.js.map +1 -0
  376. package/dist/tools/definitions/calendar.d.ts +3 -0
  377. package/dist/tools/definitions/calendar.d.ts.map +1 -0
  378. package/dist/tools/definitions/calendar.js +565 -0
  379. package/dist/tools/definitions/calendar.js.map +1 -0
  380. package/dist/tools/definitions/comments.d.ts +3 -0
  381. package/dist/tools/definitions/comments.d.ts.map +1 -0
  382. package/dist/tools/definitions/comments.js +207 -0
  383. package/dist/tools/definitions/comments.js.map +1 -0
  384. package/dist/tools/definitions/contacts.d.ts +3 -0
  385. package/dist/tools/definitions/contacts.d.ts.map +1 -0
  386. package/dist/tools/definitions/contacts.js +93 -0
  387. package/dist/tools/definitions/contacts.js.map +1 -0
  388. package/dist/tools/definitions/destructive-overrides.json +106 -0
  389. package/dist/tools/definitions/docs.d.ts +3 -0
  390. package/dist/tools/definitions/docs.d.ts.map +1 -0
  391. package/dist/tools/definitions/docs.js +416 -0
  392. package/dist/tools/definitions/docs.js.map +1 -0
  393. package/dist/tools/definitions/drive.d.ts +3 -0
  394. package/dist/tools/definitions/drive.d.ts.map +1 -0
  395. package/dist/tools/definitions/drive.js +587 -0
  396. package/dist/tools/definitions/drive.js.map +1 -0
  397. package/dist/tools/definitions/forms.d.ts +14 -0
  398. package/dist/tools/definitions/forms.d.ts.map +1 -0
  399. package/dist/tools/definitions/forms.js +189 -0
  400. package/dist/tools/definitions/forms.js.map +1 -0
  401. package/dist/tools/definitions/gmail.d.ts +3 -0
  402. package/dist/tools/definitions/gmail.d.ts.map +1 -0
  403. package/dist/tools/definitions/gmail.js +962 -0
  404. package/dist/tools/definitions/gmail.js.map +1 -0
  405. package/dist/tools/definitions/index.d.ts +33 -0
  406. package/dist/tools/definitions/index.d.ts.map +1 -0
  407. package/dist/tools/definitions/index.js +77 -0
  408. package/dist/tools/definitions/index.js.map +1 -0
  409. package/dist/tools/definitions/labels.d.ts +3 -0
  410. package/dist/tools/definitions/labels.d.ts.map +1 -0
  411. package/dist/tools/definitions/labels.js +662 -0
  412. package/dist/tools/definitions/labels.js.map +1 -0
  413. package/dist/tools/definitions/open-world-overrides.json +106 -0
  414. package/dist/tools/definitions/sheets.d.ts +3 -0
  415. package/dist/tools/definitions/sheets.d.ts.map +1 -0
  416. package/dist/tools/definitions/sheets.js +833 -0
  417. package/dist/tools/definitions/sheets.js.map +1 -0
  418. package/dist/tools/definitions/slides.d.ts +3 -0
  419. package/dist/tools/definitions/slides.d.ts.map +1 -0
  420. package/dist/tools/definitions/slides.js +383 -0
  421. package/dist/tools/definitions/slides.js.map +1 -0
  422. package/dist/tools/definitions/tasks.d.ts +11 -0
  423. package/dist/tools/definitions/tasks.d.ts.map +1 -0
  424. package/dist/tools/definitions/tasks.js +259 -0
  425. package/dist/tools/definitions/tasks.js.map +1 -0
  426. package/dist/tools/definitions.d.ts +8 -0
  427. package/dist/tools/definitions.d.ts.map +1 -0
  428. package/dist/tools/definitions.js +9 -0
  429. package/dist/tools/definitions.js.map +1 -0
  430. package/dist/tools/docs-handlers.d.ts +96 -0
  431. package/dist/tools/docs-handlers.d.ts.map +1 -0
  432. package/dist/tools/docs-handlers.js +250 -0
  433. package/dist/tools/docs-handlers.js.map +1 -0
  434. package/dist/tools/drive-handlers.d.ts +95 -0
  435. package/dist/tools/drive-handlers.d.ts.map +1 -0
  436. package/dist/tools/drive-handlers.js +506 -0
  437. package/dist/tools/drive-handlers.js.map +1 -0
  438. package/dist/tools/forms-handlers.d.ts +72 -0
  439. package/dist/tools/forms-handlers.d.ts.map +1 -0
  440. package/dist/tools/forms-handlers.js +435 -0
  441. package/dist/tools/forms-handlers.js.map +1 -0
  442. package/dist/tools/gmail-handlers.d.ts +320 -0
  443. package/dist/tools/gmail-handlers.d.ts.map +1 -0
  444. package/dist/tools/gmail-handlers.js +1040 -0
  445. package/dist/tools/gmail-handlers.js.map +1 -0
  446. package/dist/tools/param-normalizer.d.ts +2 -0
  447. package/dist/tools/param-normalizer.d.ts.map +1 -0
  448. package/dist/tools/param-normalizer.js +96 -0
  449. package/dist/tools/param-normalizer.js.map +1 -0
  450. package/dist/tools/server.d.ts +14 -0
  451. package/dist/tools/server.d.ts.map +1 -0
  452. package/dist/tools/server.js +733 -0
  453. package/dist/tools/server.js.map +1 -0
  454. package/dist/tools/sheets-handlers.d.ts +230 -0
  455. package/dist/tools/sheets-handlers.d.ts.map +1 -0
  456. package/dist/tools/sheets-handlers.js +589 -0
  457. package/dist/tools/sheets-handlers.js.map +1 -0
  458. package/dist/tools/slides-handlers.d.ts +90 -0
  459. package/dist/tools/slides-handlers.d.ts.map +1 -0
  460. package/dist/tools/slides-handlers.js +281 -0
  461. package/dist/tools/slides-handlers.js.map +1 -0
  462. package/dist/tools/tasks-handlers.d.ts +85 -0
  463. package/dist/tools/tasks-handlers.d.ts.map +1 -0
  464. package/dist/tools/tasks-handlers.js +265 -0
  465. package/dist/tools/tasks-handlers.js.map +1 -0
  466. package/dist/tools/type-guards.d.ts +491 -0
  467. package/dist/tools/type-guards.d.ts.map +1 -0
  468. package/dist/tools/type-guards.js +1325 -0
  469. package/dist/tools/type-guards.js.map +1 -0
  470. package/dist/tools/types.d.ts +298 -0
  471. package/dist/tools/types.d.ts.map +1 -0
  472. package/dist/tools/types.js +2 -0
  473. package/dist/tools/types.js.map +1 -0
  474. package/dist/types.d.ts +70 -0
  475. package/dist/types.d.ts.map +1 -0
  476. package/dist/types.js +12 -0
  477. package/dist/types.js.map +1 -0
  478. package/dist/utils/atomicCredentialWrite.d.ts +5 -0
  479. package/dist/utils/atomicCredentialWrite.d.ts.map +1 -0
  480. package/dist/utils/atomicCredentialWrite.js +120 -0
  481. package/dist/utils/atomicCredentialWrite.js.map +1 -0
  482. package/dist/utils/emfileRetry.d.ts +3 -0
  483. package/dist/utils/emfileRetry.d.ts.map +1 -0
  484. package/dist/utils/emfileRetry.js +24 -0
  485. package/dist/utils/emfileRetry.js.map +1 -0
  486. package/dist/utils/logger.d.ts +8 -0
  487. package/dist/utils/logger.d.ts.map +1 -0
  488. package/dist/utils/logger.js +67 -0
  489. package/dist/utils/logger.js.map +1 -0
  490. package/dist/utils/request-timeout.d.ts +5 -0
  491. package/dist/utils/request-timeout.d.ts.map +1 -0
  492. package/dist/utils/request-timeout.js +27 -0
  493. package/dist/utils/request-timeout.js.map +1 -0
  494. package/dist/utils/safe-filename.d.ts +2 -0
  495. package/dist/utils/safe-filename.d.ts.map +1 -0
  496. package/dist/utils/safe-filename.js +24 -0
  497. package/dist/utils/safe-filename.js.map +1 -0
  498. package/dist/utils/scope-hierarchy.d.ts +35 -0
  499. package/dist/utils/scope-hierarchy.d.ts.map +1 -0
  500. package/dist/utils/scope-hierarchy.js +123 -0
  501. package/dist/utils/scope-hierarchy.js.map +1 -0
  502. package/dist/utils/service-initializer.d.ts +12 -0
  503. package/dist/utils/service-initializer.d.ts.map +1 -0
  504. package/dist/utils/service-initializer.js +87 -0
  505. package/dist/utils/service-initializer.js.map +1 -0
  506. package/dist/utils/untrusted-content.d.ts +3 -0
  507. package/dist/utils/untrusted-content.d.ts.map +1 -0
  508. package/dist/utils/untrusted-content.js +20 -0
  509. package/dist/utils/untrusted-content.js.map +1 -0
  510. package/dist/utils/workspace.d.ts +43 -0
  511. package/dist/utils/workspace.d.ts.map +1 -0
  512. package/dist/utils/workspace.js +98 -0
  513. package/dist/utils/workspace.js.map +1 -0
  514. package/package.json +61 -0
@@ -0,0 +1,962 @@
1
+ // Gmail Tools
2
+ export const gmailTools = [
3
+ // --- Individual attachment tools (replaced legacy manage_workspace_attachment) ---
4
+ {
5
+ name: 'download_workspace_attachment',
6
+ category: 'Gmail/Messages',
7
+ description: `Download an attachment from a Gmail message or Calendar event to local storage. Returns attachment metadata including the local file path.`,
8
+ annotations: { readOnlyHint: true },
9
+ inputSchema: {
10
+ type: 'object',
11
+ properties: {
12
+ email: {
13
+ type: 'string',
14
+ description: 'Email address of the workspace account'
15
+ },
16
+ source: {
17
+ type: 'string',
18
+ enum: ['email', 'calendar'],
19
+ description: 'Source type (email or calendar)'
20
+ },
21
+ message_id: {
22
+ type: 'string',
23
+ description: 'ID of the email/event containing the attachment'
24
+ },
25
+ filename: {
26
+ type: 'string',
27
+ description: 'Name of the attachment to download'
28
+ }
29
+ },
30
+ required: ['source', 'message_id', 'filename']
31
+ }
32
+ },
33
+ {
34
+ name: 'upload_workspace_attachment',
35
+ category: 'Gmail/Messages',
36
+ description: `Upload a new attachment to local storage for a Gmail message or Calendar event. Provide base64-encoded file content.`,
37
+ annotations: { readOnlyHint: false, destructiveHint: false },
38
+ inputSchema: {
39
+ type: 'object',
40
+ properties: {
41
+ email: {
42
+ type: 'string',
43
+ description: 'Email address of the workspace account'
44
+ },
45
+ source: {
46
+ type: 'string',
47
+ enum: ['email', 'calendar'],
48
+ description: 'Source type (email or calendar)'
49
+ },
50
+ message_id: {
51
+ type: 'string',
52
+ description: 'ID of the email/event for the attachment'
53
+ },
54
+ filename: {
55
+ type: 'string',
56
+ description: 'Name of the attachment file'
57
+ },
58
+ mime_type: {
59
+ type: 'string',
60
+ description: 'MIME type of the file (e.g., application/pdf)'
61
+ },
62
+ content: {
63
+ type: 'string',
64
+ description: 'Base64 encoded file content'
65
+ }
66
+ },
67
+ required: ['source', 'message_id', 'filename', 'content']
68
+ }
69
+ },
70
+ {
71
+ name: 'delete_workspace_attachment',
72
+ category: 'Gmail/Messages',
73
+ description: `Delete an attachment from local storage. The attachment must have been previously downloaded. This action cannot be undone.`,
74
+ annotations: { readOnlyHint: false, destructiveHint: true },
75
+ inputSchema: {
76
+ type: 'object',
77
+ properties: {
78
+ email: {
79
+ type: 'string',
80
+ description: 'Email address of the workspace account'
81
+ },
82
+ source: {
83
+ type: 'string',
84
+ enum: ['email', 'calendar'],
85
+ description: 'Source type (email or calendar)'
86
+ },
87
+ message_id: {
88
+ type: 'string',
89
+ description: 'ID of the email/event containing the attachment'
90
+ },
91
+ filename: {
92
+ type: 'string',
93
+ description: 'Name of the attachment to delete'
94
+ }
95
+ },
96
+ required: ['source', 'message_id', 'filename']
97
+ }
98
+ },
99
+ {
100
+ name: 'manage_workspace_attachment',
101
+ category: 'Gmail/Messages',
102
+ description: `Legacy consolidated attachment tool. Prefer download_workspace_attachment, upload_workspace_attachment, or delete_workspace_attachment for new calls.`,
103
+ aliases: ['manage_attachment'],
104
+ annotations: { readOnlyHint: false, destructiveHint: true },
105
+ inputSchema: {
106
+ type: 'object',
107
+ properties: {
108
+ email: { type: 'string', description: 'Email address of the workspace account' },
109
+ action: { type: 'string', enum: ['download', 'upload', 'delete'], description: 'Attachment action to perform' },
110
+ source: { type: 'string', enum: ['email', 'calendar'], description: 'Source type' },
111
+ message_id: { type: 'string', description: 'ID of the email/event containing the attachment' },
112
+ filename: { type: 'string', description: 'Attachment filename' },
113
+ mime_type: { type: 'string', description: 'MIME type for upload' },
114
+ content: { type: 'string', description: 'Base64 content for upload' }
115
+ },
116
+ required: ['action', 'source', 'message_id', 'filename']
117
+ }
118
+ },
119
+ {
120
+ name: 'search_workspace_emails',
121
+ category: 'Gmail/Messages',
122
+ description: `Search emails. Example: { "query": "from:alice subject:meeting has:attachment", "max_results": 10 }
123
+
124
+ Gmail query syntax: from:, to:, subject:, has:attachment, is:unread, after:YYYY-MM-DD, before:YYYY-MM-DD, label:
125
+
126
+ Use get_workspace_email_thread with a thread_id from results to get full conversation.`,
127
+ aliases: ['search_emails', 'find_emails', 'query_emails'],
128
+ annotations: { readOnlyHint: true },
129
+ inputSchema: {
130
+ type: 'object',
131
+ properties: {
132
+ // Account (optional for single-account setups)
133
+ email: {
134
+ type: 'string',
135
+ description: 'Gmail account email (optional if only one account connected)'
136
+ },
137
+ // PRIMARY: Flat parameters (snake_case per MCP convention)
138
+ query: {
139
+ type: 'string',
140
+ description: 'Gmail search query (e.g., "from:alice subject:meeting has:attachment newer_than:7d")'
141
+ },
142
+ max_results: {
143
+ type: 'number',
144
+ description: 'Maximum emails to return (default: 10, max: 100)'
145
+ },
146
+ // COMMON FILTERS: Flat for ease of use
147
+ from: {
148
+ oneOf: [
149
+ { type: 'string' },
150
+ { type: 'array', items: { type: 'string' } }
151
+ ],
152
+ description: 'Filter by sender email or name'
153
+ },
154
+ to: {
155
+ oneOf: [
156
+ { type: 'string' },
157
+ { type: 'array', items: { type: 'string' } }
158
+ ],
159
+ description: 'Filter by recipient email'
160
+ },
161
+ subject: {
162
+ type: 'string',
163
+ description: 'Filter by subject text'
164
+ },
165
+ after: {
166
+ type: 'string',
167
+ description: 'Emails after date (YYYY-MM-DD)'
168
+ },
169
+ before: {
170
+ type: 'string',
171
+ description: 'Emails before date (YYYY-MM-DD)'
172
+ },
173
+ has_attachment: {
174
+ type: 'boolean',
175
+ description: 'Filter emails with attachments'
176
+ },
177
+ is_unread: {
178
+ type: 'boolean',
179
+ description: 'Filter by read/unread status'
180
+ },
181
+ labels: {
182
+ type: 'array',
183
+ items: { type: 'string' },
184
+ description: 'Filter by labels (e.g., INBOX, SENT, IMPORTANT)'
185
+ },
186
+ // ADDITIONAL OPTIONS (flat)
187
+ page_token: {
188
+ type: 'string',
189
+ description: 'Pagination token from previous response'
190
+ },
191
+ include_body: {
192
+ type: 'boolean',
193
+ description: 'Include full email body (default: false, returns snippet only)'
194
+ },
195
+ return_json: {
196
+ type: 'boolean',
197
+ description: 'Return JSON instead of formatted text (default: false)'
198
+ },
199
+ // LEGACY: Nested objects (backwards compatible, not recommended)
200
+ search: {
201
+ type: 'object',
202
+ description: 'Legacy: Nested search object. Prefer flat parameters above.',
203
+ properties: {
204
+ from: {
205
+ oneOf: [
206
+ { type: 'string' },
207
+ { type: 'array', items: { type: 'string' } }
208
+ ],
209
+ description: 'Search by sender email address(es)'
210
+ },
211
+ to: {
212
+ oneOf: [
213
+ { type: 'string' },
214
+ { type: 'array', items: { type: 'string' } }
215
+ ],
216
+ description: 'Search by recipient email address(es)'
217
+ },
218
+ subject: {
219
+ type: 'string',
220
+ description: 'Search in email subject lines'
221
+ },
222
+ content: {
223
+ type: 'string',
224
+ description: 'Raw Gmail query string'
225
+ },
226
+ after: {
227
+ type: 'string',
228
+ description: 'Search emails after this date (YYYY-MM-DD)'
229
+ },
230
+ before: {
231
+ type: 'string',
232
+ description: 'Search emails before this date (YYYY-MM-DD)'
233
+ },
234
+ has_attachment: {
235
+ type: 'boolean',
236
+ description: 'Filter emails with attachments'
237
+ },
238
+ labels: {
239
+ type: 'array',
240
+ items: { type: 'string' },
241
+ description: 'Include emails with these labels (e.g., INBOX, SENT, IMPORTANT)'
242
+ },
243
+ excludeLabels: {
244
+ type: 'array',
245
+ items: { type: 'string' },
246
+ description: 'Exclude emails with these labels'
247
+ },
248
+ includeSpam: {
249
+ type: 'boolean',
250
+ description: 'Include emails from spam/trash folders'
251
+ },
252
+ is_unread: {
253
+ type: 'boolean',
254
+ description: 'Filter by read/unread status'
255
+ }
256
+ }
257
+ },
258
+ options: {
259
+ type: 'object',
260
+ description: 'Legacy: Nested options object. Prefer flat parameters above.',
261
+ properties: {
262
+ maxResults: {
263
+ type: 'number',
264
+ description: 'Maximum number of emails to return (default: 10)'
265
+ },
266
+ page_token: {
267
+ type: 'string',
268
+ description: 'Token for pagination'
269
+ },
270
+ format: {
271
+ type: 'string',
272
+ enum: ['minimal', 'metadata', 'full'],
273
+ description: 'Amount of detail to return'
274
+ },
275
+ include_body: {
276
+ type: 'boolean',
277
+ description: 'Include full email body'
278
+ },
279
+ threadedView: {
280
+ type: 'boolean',
281
+ description: 'Group results by thread'
282
+ },
283
+ sortOrder: {
284
+ type: 'string',
285
+ enum: ['asc', 'desc'],
286
+ description: 'Sort order'
287
+ },
288
+ includeHeaders: {
289
+ type: 'boolean',
290
+ description: 'Include full email headers'
291
+ }
292
+ }
293
+ }
294
+ },
295
+ required: []
296
+ }
297
+ },
298
+ {
299
+ name: 'get_workspace_email_thread',
300
+ category: 'Gmail/Messages',
301
+ description: `Get all messages in an email thread/conversation.
302
+
303
+ Use this tool when you need to see the full context of an email conversation,
304
+ including all replies and the original message.
305
+
306
+ Use search_workspace_emails to FIND emails, then use this tool to get full thread context.
307
+
308
+ Supports pagination for long threads: use offset + max_messages to page through.
309
+ Example: first page { max_messages: 30 }, second page { offset: 30, max_messages: 30 }.
310
+
311
+ Returns messages in chronological order (oldest first) with:
312
+ - Full headers (from, to, cc, date, subject)
313
+ - Body content (plain text preferred, HTML fallback)
314
+ - Attachment metadata
315
+ - Pagination info (hasMore, nextOffset) when offset is used
316
+
317
+ Body summarization (default behaviour):
318
+ By default, only the LAST 2 messages return their full body to keep long
319
+ threads compact. Earlier messages return their snippet/preview only.
320
+ Set include_full_bodies: true to get every message's full body (use for
321
+ audit/forensic reads of older messages — costs more tokens). Set
322
+ include_body: false to skip bodies entirely and return thread structure only.
323
+
324
+ This is a read-only operation.`,
325
+ aliases: ['get_thread', 'read_thread', 'get_conversation'],
326
+ annotations: { readOnlyHint: true },
327
+ inputSchema: {
328
+ type: 'object',
329
+ properties: {
330
+ email: {
331
+ type: 'string',
332
+ description: 'Email address of the Gmail account'
333
+ },
334
+ thread_id: {
335
+ type: 'string',
336
+ description: 'Thread ID (from search results or message)'
337
+ },
338
+ max_messages: {
339
+ type: 'number',
340
+ description: 'Maximum messages to return (default: 50, for very long threads)'
341
+ },
342
+ offset: {
343
+ type: 'number',
344
+ description: 'Skip this many messages from the start (default: 0). Use with max_messages for pagination.'
345
+ },
346
+ include_body: {
347
+ type: 'boolean',
348
+ description: 'Include message bodies (default: true). Set false for thread structure only.'
349
+ },
350
+ include_full_bodies: {
351
+ type: 'boolean',
352
+ description: 'Return the full body of every message (default: false). When false, only the last 2 messages return their full body; earlier messages return their snippet/preview only. Set true for audit/forensic reads of older messages.'
353
+ },
354
+ return_json: {
355
+ type: 'boolean',
356
+ description: 'Return structured JSON instead of formatted text (default: false)'
357
+ }
358
+ },
359
+ required: ['thread_id']
360
+ }
361
+ },
362
+ {
363
+ name: 'compose_workspace_email',
364
+ category: 'Gmail/Messages',
365
+ description: `Open an inline editable email compose form before sending.
366
+
367
+ Use this when you want to draft an email for review/editing first. The form lets the user edit To, CC, BCC, Subject, and Body, then explicitly click Send.
368
+
369
+ This tool does not send the email directly. It prepares the draft and launches the inline form.`,
370
+ annotations: { readOnlyHint: false, destructiveHint: false },
371
+ inputSchema: {
372
+ type: 'object',
373
+ properties: {
374
+ email: {
375
+ type: 'string',
376
+ description: 'Email address to send from'
377
+ },
378
+ to: {
379
+ type: 'array',
380
+ items: { type: 'string' },
381
+ description: 'List of recipient email addresses'
382
+ },
383
+ cc: {
384
+ type: 'array',
385
+ items: { type: 'string' },
386
+ description: 'List of CC recipient email addresses'
387
+ },
388
+ bcc: {
389
+ type: 'array',
390
+ items: { type: 'string' },
391
+ description: 'List of BCC recipient email addresses'
392
+ },
393
+ subject: {
394
+ type: 'string',
395
+ description: 'Email subject'
396
+ },
397
+ body: {
398
+ type: 'string',
399
+ description: 'Email body content (plain text for compose form prefill)'
400
+ }
401
+ },
402
+ required: ['to', 'subject', 'body']
403
+ }
404
+ },
405
+ {
406
+ name: 'send_workspace_email',
407
+ category: 'Gmail/Messages',
408
+ description: `Send an email from a Gmail account.
409
+
410
+ TIP: If you are drafting an email for the user to review before sending, prefer compose_workspace_email — it opens an inline editable form so the user can edit and send themselves.
411
+
412
+ CRITICAL - PLAIN TEXT vs HTML:
413
+ - Default is PLAIN TEXT (is_html: false). Use for most emails.
414
+ - ONLY use is_html: true when you need formatting like bold, links, or lists.
415
+ - If is_html: true, body MUST be valid HTML (wrap in tags, use <br> for line breaks).
416
+ - If is_html: false (default), body is plain text (line breaks work naturally).
417
+
418
+ PLAIN TEXT (default - use this most of the time):
419
+ { "to": ["alice@example.com"], "subject": "Quick question", "body": "Hi Alice,\\n\\nCan we meet tomorrow at 3pm?\\n\\nThanks,\\nBob" }
420
+
421
+ HTML (only when formatting is needed):
422
+ { "to": ["alice@example.com"], "subject": "Meeting Summary", "body": "<p>Hi Alice,</p><p>Key points from our meeting:</p><ul><li>Budget approved</li><li>Launch date: March 1st</li></ul><p>Thanks,<br>Bob</p>", "is_html": true }
423
+
424
+ COMMON MISTAKES TO AVOID:
425
+ - Don't include HTML tags without setting is_html: true (they'll show as raw text)
426
+ - Don't set is_html: true for plain messages (unnecessary complexity)
427
+ - Don't forget <br> or <p> tags for line breaks in HTML mode
428
+
429
+ REPLY TO EXISTING EMAIL:
430
+ { "to": ["original-sender@example.com"], "subject": "Re: Meeting Tomorrow", "body": "Sounds good!\\n\\nOn Mon, Jan 6, 2026 at 10:00 AM, Alice <alice@example.com> wrote:\\n> Hey, are we still on for tomorrow's meeting?\\n> Let me know if the time works.", "reply_to_message_id": "18c5a2b3d4e5f6g7" }
431
+
432
+ IMPORTANT: For replies, use reply_to_message_id with the Gmail message ID. This auto-sets threading headers.
433
+ You MUST include quoted previous messages in the body — the threading headers alone do not include prior message content. Many recipients use non-threaded email clients or see the message in notifications without thread context. Use get_workspace_email_thread first to fetch the conversation, then include the prior messages with conventional quoting (plain text: "> " prefix with "On DATE, SENDER wrote:" header; HTML: <blockquote> tags).
434
+
435
+ FORWARD AN EMAIL:
436
+ { "to": ["bob@example.com"], "subject": "Fwd: Meeting Tomorrow", "body": "FYI see below.\\n\\n---------- Forwarded message ----------\\nFrom: Alice <alice@example.com>\\nDate: Mon, Jan 6, 2026\\nSubject: Meeting Tomorrow\\nTo: You <you@example.com>\\n\\nHey, are we still on for tomorrow's meeting?" }
437
+
438
+ For forwards, include the full original message with a forwarded message header block.
439
+
440
+ IMPORTANT - FORWARDING WITH ATTACHMENTS:
441
+ When the original email has attachments, you MUST download and re-attach them:
442
+ 1. Use get_workspace_email_thread to see which attachments exist (filenames listed per message)
443
+ 2. Use download_workspace_attachment for each attachment (source: "email", message_id, filename)
444
+ 3. Include them in the "attachments" array using the local file path returned by the download
445
+ Example: { "to": ["bob@example.com"], "subject": "Fwd: Report", "body": "See attached.\\n\\n---------- Forwarded message ----------\\n...", "attachments": [{ "path": "/path/to/downloaded/report.pdf" }] }
446
+ Attachments are NOT automatically carried over — you must explicitly download and re-attach them.`,
447
+ aliases: ['send_email', 'send_mail', 'create_email'],
448
+ annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },
449
+ inputSchema: {
450
+ type: 'object',
451
+ properties: {
452
+ email: {
453
+ type: 'string',
454
+ description: 'Email address to send from'
455
+ },
456
+ to: {
457
+ type: 'array',
458
+ items: { type: 'string' },
459
+ description: 'List of recipient email addresses'
460
+ },
461
+ subject: {
462
+ type: 'string',
463
+ description: 'Email subject (for replies, should match original with "Re: " prefix)'
464
+ },
465
+ body: {
466
+ type: 'string',
467
+ description: 'Email body content'
468
+ },
469
+ is_html: {
470
+ type: 'boolean',
471
+ description: 'Set true ONLY if body contains HTML tags (<p>, <ul>, <b>, etc.). Default: false (plain text). Most emails should NOT use this.'
472
+ },
473
+ cc: {
474
+ type: 'array',
475
+ items: { type: 'string' },
476
+ description: 'List of CC recipient email addresses'
477
+ },
478
+ bcc: {
479
+ type: 'array',
480
+ items: { type: 'string' },
481
+ description: 'List of BCC recipient email addresses'
482
+ },
483
+ reply_to_message_id: {
484
+ type: 'string',
485
+ description: 'Gmail message ID to reply to. Automatically sets threading headers (In-Reply-To, References, thread_id). Subject should match the original.'
486
+ },
487
+ attachments: {
488
+ type: 'array',
489
+ items: {
490
+ type: 'object',
491
+ properties: {
492
+ id: { type: 'string', description: 'Unique attachment ID (auto-generated from filename if using path)' },
493
+ name: { type: 'string', description: 'Filename (auto-detected from path if not provided)' },
494
+ mimeType: { type: 'string', description: 'MIME type (auto-detected from path if not provided)' },
495
+ size: { type: 'number', description: 'Size in bytes (auto-detected from path if not provided)' },
496
+ content: { type: 'string', description: 'Base64-encoded file content (not needed if path is provided)' },
497
+ path: { type: 'string', description: 'Local file path — alternative to content. Server reads and encodes the file automatically. All other fields are auto-detected from the file.' }
498
+ },
499
+ required: []
500
+ },
501
+ description: 'Attachments. Provide either "path" (preferred for local files) or "content" (base64). When using path, name/mimeType/size are auto-detected.'
502
+ }
503
+ },
504
+ required: ['to', 'subject', 'body']
505
+ }
506
+ },
507
+ // --- Gmail Quick Action tools ---
508
+ {
509
+ name: 'archive_workspace_email',
510
+ category: 'Gmail/Messages',
511
+ description: `Archive a Gmail message (remove it from the Inbox). The message remains accessible via search and labels.
512
+
513
+ Supports batch: provide either a single message_id or an array of message_ids.
514
+
515
+ Note: This operates on individual messages, not entire threads.
516
+
517
+ Examples:
518
+ 1. Archive one message: { "message_id": "18c5a2b3d4e5f6g7" }
519
+ 2. Archive multiple: { "message_ids": ["18c5a2b3d4e5f6g7", "18c5a2b3d4e5f6g8"] }`,
520
+ aliases: ['archive_email'],
521
+ annotations: { readOnlyHint: false, destructiveHint: true },
522
+ inputSchema: {
523
+ type: 'object',
524
+ properties: {
525
+ email: {
526
+ type: 'string',
527
+ description: 'Email address of the Gmail account'
528
+ },
529
+ message_id: {
530
+ type: 'string',
531
+ description: 'ID of the message to archive'
532
+ },
533
+ message_ids: {
534
+ type: 'array',
535
+ items: { type: 'string' },
536
+ description: 'Array of message IDs to archive (for batch operations)'
537
+ }
538
+ },
539
+ required: []
540
+ }
541
+ },
542
+ {
543
+ name: 'trash_workspace_email',
544
+ category: 'Gmail/Messages',
545
+ description: `Move a Gmail message to the trash. Trashed messages are permanently deleted after 30 days.
546
+
547
+ Supports batch: provide either a single message_id or an array of message_ids.
548
+
549
+ Note: This operates on individual messages, not entire threads. Use untrash_workspace_email to restore.
550
+
551
+ Examples:
552
+ 1. Trash one message: { "message_id": "18c5a2b3d4e5f6g7" }
553
+ 2. Trash multiple: { "message_ids": ["18c5a2b3d4e5f6g7", "18c5a2b3d4e5f6g8"] }`,
554
+ aliases: ['trash_email', 'delete_email'],
555
+ annotations: { readOnlyHint: false, destructiveHint: true },
556
+ inputSchema: {
557
+ type: 'object',
558
+ properties: {
559
+ email: {
560
+ type: 'string',
561
+ description: 'Email address of the Gmail account'
562
+ },
563
+ message_id: {
564
+ type: 'string',
565
+ description: 'ID of the message to trash'
566
+ },
567
+ message_ids: {
568
+ type: 'array',
569
+ items: { type: 'string' },
570
+ description: 'Array of message IDs to trash (for batch operations)'
571
+ }
572
+ },
573
+ required: []
574
+ }
575
+ },
576
+ {
577
+ name: 'untrash_workspace_email',
578
+ category: 'Gmail/Messages',
579
+ description: `Restore a Gmail message from the trash. The message returns to its previous location.
580
+
581
+ Supports batch: provide either a single message_id or an array of message_ids.
582
+
583
+ Note: This operates on individual messages, not entire threads.
584
+
585
+ Examples:
586
+ 1. Restore one message: { "message_id": "18c5a2b3d4e5f6g7" }
587
+ 2. Restore multiple: { "message_ids": ["18c5a2b3d4e5f6g7", "18c5a2b3d4e5f6g8"] }`,
588
+ aliases: ['untrash_email', 'restore_email'],
589
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
590
+ inputSchema: {
591
+ type: 'object',
592
+ properties: {
593
+ email: {
594
+ type: 'string',
595
+ description: 'Email address of the Gmail account'
596
+ },
597
+ message_id: {
598
+ type: 'string',
599
+ description: 'ID of the message to restore from trash'
600
+ },
601
+ message_ids: {
602
+ type: 'array',
603
+ items: { type: 'string' },
604
+ description: 'Array of message IDs to restore (for batch operations)'
605
+ }
606
+ },
607
+ required: []
608
+ }
609
+ },
610
+ {
611
+ name: 'mark_workspace_email_read',
612
+ category: 'Gmail/Messages',
613
+ description: `Mark a Gmail message as read.
614
+
615
+ Supports batch: provide either a single message_id or an array of message_ids.
616
+
617
+ Note: This operates on individual messages, not entire threads.
618
+
619
+ Examples:
620
+ 1. Mark one as read: { "message_id": "18c5a2b3d4e5f6g7" }
621
+ 2. Mark multiple: { "message_ids": ["18c5a2b3d4e5f6g7", "18c5a2b3d4e5f6g8"] }`,
622
+ aliases: ['mark_read', 'mark_email_read'],
623
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
624
+ inputSchema: {
625
+ type: 'object',
626
+ properties: {
627
+ email: {
628
+ type: 'string',
629
+ description: 'Email address of the Gmail account'
630
+ },
631
+ message_id: {
632
+ type: 'string',
633
+ description: 'ID of the message to mark as read'
634
+ },
635
+ message_ids: {
636
+ type: 'array',
637
+ items: { type: 'string' },
638
+ description: 'Array of message IDs to mark as read (for batch operations)'
639
+ }
640
+ },
641
+ required: []
642
+ }
643
+ },
644
+ {
645
+ name: 'mark_workspace_email_unread',
646
+ category: 'Gmail/Messages',
647
+ description: `Mark a Gmail message as unread.
648
+
649
+ Supports batch: provide either a single message_id or an array of message_ids.
650
+
651
+ Note: This operates on individual messages, not entire threads.
652
+
653
+ Examples:
654
+ 1. Mark one as unread: { "message_id": "18c5a2b3d4e5f6g7" }
655
+ 2. Mark multiple: { "message_ids": ["18c5a2b3d4e5f6g7", "18c5a2b3d4e5f6g8"] }`,
656
+ aliases: ['mark_unread', 'mark_email_unread'],
657
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
658
+ inputSchema: {
659
+ type: 'object',
660
+ properties: {
661
+ email: {
662
+ type: 'string',
663
+ description: 'Email address of the Gmail account'
664
+ },
665
+ message_id: {
666
+ type: 'string',
667
+ description: 'ID of the message to mark as unread'
668
+ },
669
+ message_ids: {
670
+ type: 'array',
671
+ items: { type: 'string' },
672
+ description: 'Array of message IDs to mark as unread (for batch operations)'
673
+ }
674
+ },
675
+ required: []
676
+ }
677
+ },
678
+ {
679
+ name: 'get_workspace_gmail_settings',
680
+ category: 'Gmail/Settings',
681
+ description: `Get Gmail settings and profile information for a workspace account.
682
+
683
+ IMPORTANT: Always verify account access first with list_workspace_accounts.
684
+
685
+ Common Uses:
686
+ - Check account configuration
687
+ - Verify email settings
688
+ - Access profile information
689
+
690
+ Response includes:
691
+ - Language settings
692
+ - Signature settings
693
+ - Vacation responder status
694
+ - Filters and forwarding
695
+ - Other account preferences`,
696
+ aliases: ['get_gmail_settings', 'gmail_settings', 'get_mail_settings'],
697
+ annotations: { readOnlyHint: true },
698
+ inputSchema: {
699
+ type: 'object',
700
+ properties: {
701
+ email: {
702
+ type: 'string',
703
+ description: 'Email address of the Gmail account'
704
+ }
705
+ },
706
+ required: []
707
+ }
708
+ },
709
+ // --- Individual draft tools (replaced legacy manage_workspace_draft) ---
710
+ {
711
+ name: 'list_workspace_drafts',
712
+ category: 'Gmail/Drafts',
713
+ description: `List all Gmail drafts for the account. Returns draft IDs and message snippets for each draft.`,
714
+ annotations: { readOnlyHint: true },
715
+ inputSchema: {
716
+ type: 'object',
717
+ properties: {
718
+ email: {
719
+ type: 'string',
720
+ description: 'Email address of the Gmail account'
721
+ }
722
+ },
723
+ required: []
724
+ }
725
+ },
726
+ {
727
+ name: 'get_workspace_draft',
728
+ category: 'Gmail/Drafts',
729
+ description: `Get a specific Gmail draft by ID. Returns the full draft content including recipients, subject, body, and attachments.`,
730
+ annotations: { readOnlyHint: true },
731
+ inputSchema: {
732
+ type: 'object',
733
+ properties: {
734
+ email: {
735
+ type: 'string',
736
+ description: 'Email address of the Gmail account'
737
+ },
738
+ draft_id: {
739
+ type: 'string',
740
+ description: 'ID of the draft to retrieve'
741
+ }
742
+ },
743
+ required: ['draft_id']
744
+ }
745
+ },
746
+ {
747
+ name: 'create_workspace_draft',
748
+ category: 'Gmail/Drafts',
749
+ description: `Create a new Gmail draft. Supports plain text and HTML bodies, CC/BCC, reply threading, and attachments.`,
750
+ annotations: { readOnlyHint: false, destructiveHint: false },
751
+ inputSchema: {
752
+ type: 'object',
753
+ properties: {
754
+ email: {
755
+ type: 'string',
756
+ description: 'Email address of the Gmail account'
757
+ },
758
+ to: {
759
+ type: 'array',
760
+ items: { type: 'string' },
761
+ description: 'List of recipient email addresses'
762
+ },
763
+ subject: {
764
+ type: 'string',
765
+ description: 'Email subject'
766
+ },
767
+ body: {
768
+ type: 'string',
769
+ description: 'Email body content. Plain text by default — use \\n for line breaks. If you need HTML formatting (bold, lists, links), you MUST also set is_html: true or HTML tags will show as raw text in Gmail.'
770
+ },
771
+ is_html: {
772
+ type: 'boolean',
773
+ description: 'Set true ONLY if body contains HTML tags (<p>, <ul>, <b>, etc.). Default: false (plain text). WARNING: If body contains HTML tags but is_html is false, tags will show as raw text in Gmail. Most drafts should use plain text.'
774
+ },
775
+ cc: {
776
+ type: 'array',
777
+ items: { type: 'string' },
778
+ description: 'List of CC recipient email addresses'
779
+ },
780
+ bcc: {
781
+ type: 'array',
782
+ items: { type: 'string' },
783
+ description: 'List of BCC recipient email addresses'
784
+ },
785
+ reply_to_message_id: {
786
+ type: 'string',
787
+ description: 'Message ID to reply to (for creating reply drafts)'
788
+ },
789
+ thread_id: {
790
+ type: 'string',
791
+ description: 'Thread ID for the email (optional for replies)'
792
+ },
793
+ in_reply_to: {
794
+ type: 'string',
795
+ description: 'Message ID being replied to (for email threading)'
796
+ },
797
+ references: {
798
+ type: 'array',
799
+ items: { type: 'string' },
800
+ description: 'Reference message IDs for email threading'
801
+ },
802
+ attachments: {
803
+ type: 'array',
804
+ items: {
805
+ type: 'object',
806
+ properties: {
807
+ id: { type: 'string', description: 'Unique attachment ID (auto-generated from filename if using path)' },
808
+ name: { type: 'string', description: 'Filename (auto-detected from path if not provided)' },
809
+ mimeType: { type: 'string', description: 'MIME type (auto-detected from path if not provided)' },
810
+ size: { type: 'number', description: 'Size in bytes (auto-detected from path if not provided)' },
811
+ content: { type: 'string', description: 'Base64-encoded file content (not needed if path is provided)' },
812
+ path: { type: 'string', description: 'Local file path — alternative to content. Server reads and encodes the file automatically. All other fields are auto-detected from the file.' }
813
+ },
814
+ required: []
815
+ },
816
+ description: 'Attachments. Provide either "path" (preferred for local files) or "content" (base64). When using path, name/mimeType/size are auto-detected.'
817
+ }
818
+ },
819
+ required: ['to', 'subject', 'body']
820
+ }
821
+ },
822
+ {
823
+ name: 'update_workspace_draft',
824
+ category: 'Gmail/Drafts',
825
+ description: `Update an existing Gmail draft. Replaces the draft content with the provided fields. Supports attachments and reply threading.`,
826
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
827
+ inputSchema: {
828
+ type: 'object',
829
+ properties: {
830
+ email: {
831
+ type: 'string',
832
+ description: 'Email address of the Gmail account'
833
+ },
834
+ draft_id: {
835
+ type: 'string',
836
+ description: 'ID of the draft to update'
837
+ },
838
+ to: {
839
+ type: 'array',
840
+ items: { type: 'string' },
841
+ description: 'List of recipient email addresses'
842
+ },
843
+ subject: {
844
+ type: 'string',
845
+ description: 'Email subject'
846
+ },
847
+ body: {
848
+ type: 'string',
849
+ description: 'Email body content. Plain text by default — use \\n for line breaks. If you need HTML formatting (bold, lists, links), you MUST also set is_html: true or HTML tags will show as raw text in Gmail.'
850
+ },
851
+ is_html: {
852
+ type: 'boolean',
853
+ description: 'Set true ONLY if body contains HTML tags (<p>, <ul>, <b>, etc.). Default: false (plain text). WARNING: If body contains HTML tags but is_html is false, tags will show as raw text in Gmail. Most drafts should use plain text.'
854
+ },
855
+ cc: {
856
+ type: 'array',
857
+ items: { type: 'string' },
858
+ description: 'List of CC recipient email addresses'
859
+ },
860
+ bcc: {
861
+ type: 'array',
862
+ items: { type: 'string' },
863
+ description: 'List of BCC recipient email addresses'
864
+ },
865
+ reply_to_message_id: {
866
+ type: 'string',
867
+ description: 'Message ID to reply to (for creating reply drafts)'
868
+ },
869
+ thread_id: {
870
+ type: 'string',
871
+ description: 'Thread ID for the email (optional for replies)'
872
+ },
873
+ in_reply_to: {
874
+ type: 'string',
875
+ description: 'Message ID being replied to (for email threading)'
876
+ },
877
+ references: {
878
+ type: 'array',
879
+ items: { type: 'string' },
880
+ description: 'Reference message IDs for email threading'
881
+ },
882
+ attachments: {
883
+ type: 'array',
884
+ items: {
885
+ type: 'object',
886
+ properties: {
887
+ id: { type: 'string', description: 'Unique attachment ID (auto-generated from filename if using path)' },
888
+ name: { type: 'string', description: 'Filename (auto-detected from path if not provided)' },
889
+ mimeType: { type: 'string', description: 'MIME type (auto-detected from path if not provided)' },
890
+ size: { type: 'number', description: 'Size in bytes (auto-detected from path if not provided)' },
891
+ content: { type: 'string', description: 'Base64-encoded file content (not needed if path is provided)' },
892
+ path: { type: 'string', description: 'Local file path — alternative to content. Server reads and encodes the file automatically. All other fields are auto-detected from the file.' }
893
+ },
894
+ required: []
895
+ },
896
+ description: 'Attachments. Provide either "path" (preferred for local files) or "content" (base64). When using path, name/mimeType/size are auto-detected.'
897
+ }
898
+ },
899
+ required: ['draft_id', 'to', 'subject', 'body']
900
+ }
901
+ },
902
+ {
903
+ name: 'delete_workspace_draft',
904
+ category: 'Gmail/Drafts',
905
+ description: `Delete a Gmail draft permanently. This action cannot be undone.`,
906
+ annotations: { readOnlyHint: false, destructiveHint: true },
907
+ inputSchema: {
908
+ type: 'object',
909
+ properties: {
910
+ email: {
911
+ type: 'string',
912
+ description: 'Email address of the Gmail account'
913
+ },
914
+ draft_id: {
915
+ type: 'string',
916
+ description: 'ID of the draft to delete'
917
+ }
918
+ },
919
+ required: ['draft_id']
920
+ }
921
+ },
922
+ {
923
+ name: 'send_workspace_draft',
924
+ category: 'Gmail/Drafts',
925
+ description: `Send an existing Gmail draft as an email. The draft will be removed from drafts after sending.`,
926
+ annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },
927
+ inputSchema: {
928
+ type: 'object',
929
+ properties: {
930
+ email: {
931
+ type: 'string',
932
+ description: 'Email address of the Gmail account'
933
+ },
934
+ draft_id: {
935
+ type: 'string',
936
+ description: 'ID of the draft to send'
937
+ }
938
+ },
939
+ required: ['draft_id']
940
+ }
941
+ },
942
+ {
943
+ name: 'manage_workspace_draft',
944
+ category: 'Gmail/Drafts',
945
+ description: `Legacy consolidated draft tool. Prefer the individual draft tools for new calls.`,
946
+ aliases: ['manage_draft'],
947
+ annotations: { readOnlyHint: false, destructiveHint: true },
948
+ inputSchema: {
949
+ type: 'object',
950
+ properties: {
951
+ email: { type: 'string', description: 'Email address of the Gmail account' },
952
+ action: { type: 'string', enum: ['create', 'list', 'get', 'update', 'delete', 'send'], description: 'Draft action to perform' },
953
+ draft_id: { type: 'string', description: 'Draft ID for get/update/delete/send' },
954
+ to: { type: 'array', items: { type: 'string' }, description: 'Recipients for create/update' },
955
+ subject: { type: 'string', description: 'Email subject for create/update' },
956
+ body: { type: 'string', description: 'Email body for create/update' }
957
+ },
958
+ required: ['action']
959
+ }
960
+ }
961
+ ];
962
+ //# sourceMappingURL=gmail.js.map