google-tools-mcp 1.0.12 → 1.0.13

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/dist/helpers.js CHANGED
@@ -109,6 +109,8 @@ export const wrapTextBody = (text) => text.split('\n').map(line => {
109
109
  return chunks.join('=\n');
110
110
  }).join('\n');
111
111
 
112
+ export const isHtmlBody = (text) => /<\/?[a-z][\s\S]*?>/i.test(text);
113
+
112
114
  export const constructRawMessage = async (gmail, params) => {
113
115
  let thread = null;
114
116
  if (params.threadId) {
@@ -126,11 +128,12 @@ export const constructRawMessage = async (gmail, params) => {
126
128
  } else {
127
129
  message.push('Subject: (No Subject)');
128
130
  }
129
- message.push('Content-Type: text/plain; charset="UTF-8"');
131
+ const htmlMode = params.body && isHtmlBody(params.body);
132
+ message.push(`Content-Type: ${htmlMode ? 'text/html' : 'text/plain'}; charset="UTF-8"`);
130
133
  message.push('Content-Transfer-Encoding: quoted-printable');
131
134
  message.push('MIME-Version: 1.0');
132
135
  message.push('');
133
- if (params.body) message.push(wrapTextBody(params.body));
136
+ if (params.body) message.push(htmlMode ? params.body : wrapTextBody(params.body));
134
137
  if (thread) {
135
138
  const quotedContent = getQuotedContent(thread);
136
139
  if (quotedContent) {
@@ -168,9 +171,10 @@ export const constructRawMessageWithAttachments = async (gmail, params) => {
168
171
  const quotedContent = getQuotedContent(thread);
169
172
  if (quotedContent) bodyText += '\n\n' + quotedContent;
170
173
  }
174
+ const htmlMode = isHtmlBody(bodyText);
171
175
  parts.push([
172
176
  `--${boundary}`,
173
- 'Content-Type: text/plain; charset="UTF-8"',
177
+ `Content-Type: ${htmlMode ? 'text/html' : 'text/plain'}; charset="UTF-8"`,
174
178
  'Content-Transfer-Encoding: base64',
175
179
  '',
176
180
  Buffer.from(bodyText).toString('base64'),
@@ -15,7 +15,7 @@ export function register(server) {
15
15
  cc: z.array(z.string()).optional().describe("List of CC recipient email addresses"),
16
16
  bcc: z.array(z.string()).optional().describe("List of BCC recipient email addresses"),
17
17
  subject: z.string().optional().describe("The subject of the email"),
18
- body: z.string().optional().describe("The body of the email"),
18
+ body: z.string().optional().describe("The body of the email. Supports plain text or HTML (auto-detected). Use HTML tags like <p>, <br>, <b> for formatted emails."),
19
19
  attachments: z.array(z.object({
20
20
  filename: z.string().describe("Attachment file name"),
21
21
  mimeType: z.string().describe("MIME type of the attachment"),
@@ -56,7 +56,7 @@ export function register(server) {
56
56
  cc: z.array(z.string()).optional().describe("List of CC recipient email addresses"),
57
57
  bcc: z.array(z.string()).optional().describe("List of BCC recipient email addresses"),
58
58
  subject: z.string().optional().describe("The subject of the email"),
59
- body: z.string().optional().describe("The body of the email"),
59
+ body: z.string().optional().describe("The body of the email. Supports plain text or HTML (auto-detected). Use HTML tags like <p>, <br>, <b> for formatted emails."),
60
60
  attachments: z.array(z.object({
61
61
  filename: z.string().describe("Attachment file name"),
62
62
  mimeType: z.string().describe("MIME type of the attachment"),
@@ -15,7 +15,7 @@ export function register(server) {
15
15
  cc: z.array(z.string()).optional().describe("List of CC recipient email addresses"),
16
16
  bcc: z.array(z.string()).optional().describe("List of BCC recipient email addresses"),
17
17
  subject: z.string().optional().describe("The subject of the email"),
18
- body: z.string().optional().describe("The body of the email"),
18
+ body: z.string().optional().describe("The body of the email. Supports plain text or HTML (auto-detected). Use HTML tags like <p>, <br>, <b> for formatted emails."),
19
19
  attachments: z.array(z.object({
20
20
  filename: z.string().describe("Attachment file name"),
21
21
  mimeType: z.string().describe("MIME type of the attachment"),
@@ -56,7 +56,7 @@ export function register(server) {
56
56
  cc: z.array(z.string()).optional().describe("List of CC recipient email addresses"),
57
57
  bcc: z.array(z.string()).optional().describe("List of BCC recipient email addresses"),
58
58
  subject: z.string().optional().describe("The subject of the email"),
59
- body: z.string().optional().describe("The body of the email"),
59
+ body: z.string().optional().describe("The body of the email. Supports plain text or HTML (auto-detected). Use HTML tags like <p>, <br>, <b> for formatted emails."),
60
60
  attachments: z.array(z.object({
61
61
  filename: z.string().describe("Attachment file name"),
62
62
  mimeType: z.string().describe("MIME type of the attachment"),
@@ -14,7 +14,7 @@ export function register(server) {
14
14
  cc: z.array(z.string()).optional().describe("List of CC recipient email addresses"),
15
15
  bcc: z.array(z.string()).optional().describe("List of BCC recipient email addresses"),
16
16
  subject: z.string().optional().describe("The subject of the email"),
17
- body: z.string().optional().describe("The body of the email"),
17
+ body: z.string().optional().describe("The body of the email. Supports plain text or HTML (auto-detected). Use HTML tags like <p>, <br>, <b> for formatted emails."),
18
18
  attachments: z.array(z.object({
19
19
  filename: z.string().describe("Attachment file name"),
20
20
  mimeType: z.string().describe("MIME type of the attachment"),
@@ -49,7 +49,7 @@ export function register(server) {
49
49
  description: 'Reply to a message. Automatically handles To/Cc recipients, subject prefix, threading headers, and quoted content. Use replyAll to include all original recipients.',
50
50
  parameters: z.object({
51
51
  messageId: z.string().describe("The ID of the message to reply to"),
52
- body: z.string().describe("The reply body text"),
52
+ body: z.string().describe("The reply body text. Supports plain text or HTML (auto-detected). Use HTML tags like <p>, <br>, <b> for formatted replies."),
53
53
  replyAll: z.boolean().optional().describe("If true, reply to all original recipients (To + Cc minus yourself). Default: false"),
54
54
  to: z.array(z.string()).optional().describe("Override recipient list (if omitted, replies to sender or Reply-To)"),
55
55
  cc: z.array(z.string()).optional().describe("Override CC list (if omitted and replyAll, uses original To + Cc minus yourself)"),
@@ -168,7 +168,7 @@ export function register(server) {
168
168
  to: z.array(z.string()).describe("Recipient email addresses to forward to"),
169
169
  cc: z.array(z.string()).optional().describe("CC recipient email addresses"),
170
170
  bcc: z.array(z.string()).optional().describe("BCC recipient email addresses"),
171
- body: z.string().optional().describe("Optional commentary to prepend above the forwarded content"),
171
+ body: z.string().optional().describe("Optional commentary to prepend above the forwarded content. Supports plain text or HTML (auto-detected)."),
172
172
  includeAttachments: z.boolean().optional().describe("Whether to include original attachments. Default: true"),
173
173
  includeBodyHtml: z.boolean().optional().describe("Whether to include the parsed HTML in the return"),
174
174
  }),
@@ -14,7 +14,7 @@ export function register(server) {
14
14
  cc: z.array(z.string()).optional().describe("List of CC recipient email addresses"),
15
15
  bcc: z.array(z.string()).optional().describe("List of BCC recipient email addresses"),
16
16
  subject: z.string().optional().describe("The subject of the email"),
17
- body: z.string().optional().describe("The body of the email"),
17
+ body: z.string().optional().describe("The body of the email. Supports plain text or HTML (auto-detected). Use HTML tags like <p>, <br>, <b> for formatted emails."),
18
18
  attachments: z.array(z.object({
19
19
  filename: z.string().describe("Attachment file name"),
20
20
  mimeType: z.string().describe("MIME type of the attachment"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "google-tools-mcp",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Combined Google Workspace MCP server (Drive, Docs, Sheets, Gmail) with lazy-loaded tool categories",
5
5
  "type": "module",
6
6
  "bin": {