groundmail-mcp 0.13.0 → 0.14.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 (2) hide show
  1. package/dist/index.js +96 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -221,6 +221,25 @@ var suppressionItem = object(
221
221
  },
222
222
  ["id", "email"]
223
223
  );
224
+ var categoryOptOutItem = object(
225
+ {
226
+ id: string("Category opt-out id"),
227
+ type: string("Always category_opt_out"),
228
+ email: string("Address that opted out"),
229
+ category: string("Category the address opted out of: product or newsletter"),
230
+ tenant: nullableString("External id of the tenant whose email the reader left; null when account-wide"),
231
+ created_at: string("When the reader opted out (ISO 8601)"),
232
+ updated_at: string("When the opt-out was last changed (ISO 8601)")
233
+ },
234
+ ["id", "email", "category"]
235
+ );
236
+ var removeCategoryOptOutOutput = object(
237
+ {
238
+ ok: boolean("True when the request completed"),
239
+ deleted: number("How many opt-outs were removed")
240
+ },
241
+ ["ok"]
242
+ );
224
243
  var templateItem = object(
225
244
  {
226
245
  id: string("Template id (tpl_\u2026)"),
@@ -773,6 +792,39 @@ async function callMcpTool(client, name, args) {
773
792
  const tenant = optString(args, "tenant");
774
793
  return textResult(tenant ? await client.suppressions.remove(idOrEmail, { tenant }) : await client.suppressions.remove(idOrEmail));
775
794
  }
795
+ case "list_category_opt_outs": {
796
+ const category = optString(args, "category");
797
+ if (category && category !== "product" && category !== "newsletter") {
798
+ return textResult("category must be product or newsletter", true);
799
+ }
800
+ return textResult(
801
+ await client.suppressions.listCategoryOptOuts({
802
+ limit: optNumber(args, "limit"),
803
+ cursor: optString(args, "cursor"),
804
+ email: optString(args, "email"),
805
+ ...category ? { category } : {},
806
+ ...optString(args, "tenant") ? { tenant: optString(args, "tenant") } : {},
807
+ ...args.include_tenants === true ? { includeTenants: true } : {}
808
+ })
809
+ );
810
+ }
811
+ case "remove_category_opt_out": {
812
+ const idOrEmail = optString(args, "id") ?? optString(args, "email");
813
+ if (!idOrEmail) {
814
+ return textResult("Missing required argument: id or email", true);
815
+ }
816
+ const category = optString(args, "category");
817
+ if (category && category !== "product" && category !== "newsletter") {
818
+ return textResult("category must be product or newsletter", true);
819
+ }
820
+ const tenant = optString(args, "tenant");
821
+ return textResult(
822
+ await client.suppressions.removeCategoryOptOut(idOrEmail, {
823
+ ...category ? { category } : {},
824
+ ...tenant ? { tenant } : {}
825
+ })
826
+ );
827
+ }
776
828
  case "list_templates": {
777
829
  const status = optString(args, "status");
778
830
  return textResult(
@@ -1280,6 +1332,50 @@ var MCP_TOOLS = [
1280
1332
  openWorldHint: false
1281
1333
  }
1282
1334
  },
1335
+ {
1336
+ name: "list_category_opt_outs",
1337
+ description: "List category opt-outs: addresses that used a one-click unsubscribe to leave product or newsletter email. Sends in that category to them are refused until the opt-out is removed.",
1338
+ inputSchema: {
1339
+ type: "object",
1340
+ properties: {
1341
+ ...paginationProps,
1342
+ email: { type: "string", description: "Optional filter by email" },
1343
+ category: { type: "string", enum: ["product", "newsletter"], description: "Optional filter by category" },
1344
+ tenant: tenantProp("List this tenant's opt-outs instead of the account-wide ones"),
1345
+ include_tenants: {
1346
+ type: "boolean",
1347
+ description: "Without tenant: also list every tenant's opt-outs (each entry names its tenant)"
1348
+ }
1349
+ }
1350
+ },
1351
+ outputSchema: pagedOutput("data", categoryOptOutItem, "Category opt-outs on this page"),
1352
+ annotations: readOnly("List category opt-outs")
1353
+ },
1354
+ {
1355
+ name: "remove_category_opt_out",
1356
+ description: "Remove a category opt-out by id or email address so the address receives that category again. Use only when the reader has asked to re-subscribe.",
1357
+ inputSchema: {
1358
+ type: "object",
1359
+ properties: {
1360
+ id: { type: "string", description: "Category opt-out id" },
1361
+ email: { type: "string", description: "Email address (alternative to id)" },
1362
+ category: {
1363
+ type: "string",
1364
+ enum: ["product", "newsletter"],
1365
+ description: "Only this category; omit to remove every category for the address"
1366
+ },
1367
+ tenant: tenantProp("Remove from this tenant's opt-outs instead of the account-wide ones")
1368
+ }
1369
+ },
1370
+ outputSchema: removeCategoryOptOutOutput,
1371
+ annotations: {
1372
+ title: "Remove category opt-out",
1373
+ readOnlyHint: false,
1374
+ destructiveHint: true,
1375
+ idempotentHint: true,
1376
+ openWorldHint: false
1377
+ }
1378
+ },
1283
1379
  {
1284
1380
  name: "list_templates",
1285
1381
  description: "List email templates.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "groundmail-mcp",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "mcpName": "io.github.Groundmail/groundmail",
5
5
  "description": "Groundmail MCP server: send transactional email, manage domains, templates, webhooks and suppressions from Claude, Cursor, ChatGPT and other MCP clients",
6
6
  "license": "MIT",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@modelcontextprotocol/sdk": "^1.30.0",
44
- "groundmail": "0.22.0"
44
+ "groundmail": "0.24.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "tsup": "^8.5.0",