groundmail-mcp 0.24.0 → 0.25.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 +115 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -88,6 +88,7 @@ var nullableString = (description) => ({ type: ["string", "null"], description }
88
88
  var string = (description) => ({ type: "string", description });
89
89
  var boolean = (description) => ({ type: "boolean", description });
90
90
  var number = (description) => ({ type: "number", description });
91
+ var nullableNumber = (description) => ({ type: ["number", "null"], description });
91
92
  var stringArray = (description) => ({
92
93
  type: "array",
93
94
  items: { type: "string" },
@@ -251,11 +252,37 @@ var webhookItem = object(
251
252
  events: stringArray("Event types delivered to this endpoint"),
252
253
  enabled: boolean("Whether the endpoint receives events"),
253
254
  tenants: stringArray("Present only when the endpoint receives email events for some tenants only: their external ids"),
255
+ health: {
256
+ type: "object",
257
+ description: "Delivery health: last_24h (total, delivered, failed, median_latency_ms), last_delivery_at, last_status, last_response_status, and failing (a delivery failed all 5 attempts in the last 24 hours)"
258
+ },
254
259
  created_at: string("When the endpoint was created (ISO 8601)"),
255
260
  updated_at: string("When the endpoint was last changed (ISO 8601)")
256
261
  },
257
262
  ["id", "url", "events"]
258
263
  );
264
+ var webhookDeliveryItem = object(
265
+ {
266
+ id: string("Delivery id"),
267
+ webhook_id: string("The endpoint it was sent to"),
268
+ event: string("Event type"),
269
+ status: string("pending, retrying, delivered or failed"),
270
+ attempt_count: number("Attempts made so far"),
271
+ max_attempts: number("Attempts this delivery gets"),
272
+ email_id: nullableString("The email this event is about"),
273
+ recipient: nullableString("The first recipient, or the contact"),
274
+ test: boolean("True for a simulated event"),
275
+ response_status: nullableNumber("HTTP status of the latest attempt"),
276
+ error_kind: nullableString("Why nothing answered: timeout or connection"),
277
+ latency_ms: nullableNumber("Response time of the latest attempt in ms"),
278
+ last_attempt_at: nullableString("When the latest attempt started (ISO 8601)"),
279
+ next_attempt_at: nullableString("When the next retry runs (ISO 8601)"),
280
+ resent_from: nullableString("The delivery this one resends"),
281
+ created_at: string("When the delivery was created (ISO 8601)"),
282
+ updated_at: string("When the delivery last changed (ISO 8601)")
283
+ },
284
+ ["id", "webhook_id", "event", "status"]
285
+ );
259
286
  var suppressionItem = object(
260
287
  {
261
288
  id: string("Suppression id"),
@@ -446,6 +473,15 @@ var createWebhookOutput = object(
446
473
  },
447
474
  ["webhook", "secret"]
448
475
  );
476
+ var webhookDeliveryOutput = object(
477
+ {
478
+ delivery: {
479
+ ...described(webhookDeliveryItem, "The delivery, with `attempts` and the `payload` sent"),
480
+ additionalProperties: true
481
+ }
482
+ },
483
+ ["delivery"]
484
+ );
449
485
  var suppressionOutput = object({ suppression: described(suppressionItem, "The suppression entry") }, ["suppression"]);
450
486
  var templateOutput = object({ template: described(templateItem, "The template") }, ["template"]);
451
487
  var testWebhookOutput = object(
@@ -555,7 +591,6 @@ var migrationOutput = object(
555
591
  },
556
592
  ["migration"]
557
593
  );
558
- var nullableNumber = (description) => ({ type: ["number", "null"], description });
559
594
  var tenantItem = object(
560
595
  {
561
596
  id: string("Groundmail tenant id"),
@@ -965,6 +1000,32 @@ async function callMcpTool(client, name, args) {
965
1000
  })
966
1001
  );
967
1002
  }
1003
+ case "list_webhook_deliveries": {
1004
+ const webhookId = optString(args, "webhook_id");
1005
+ if (!webhookId) return textResult("Missing required argument: webhook_id", true);
1006
+ return textResult(
1007
+ await client.webhooks.deliveries.list(webhookId, {
1008
+ limit: optNumber(args, "limit"),
1009
+ cursor: optString(args, "cursor"),
1010
+ status: optString(args, "status"),
1011
+ event: optString(args, "event"),
1012
+ email_id: optString(args, "email_id"),
1013
+ q: optString(args, "q")
1014
+ })
1015
+ );
1016
+ }
1017
+ case "get_webhook_delivery": {
1018
+ const webhookId = optString(args, "webhook_id");
1019
+ const id = optString(args, "id");
1020
+ if (!webhookId || !id) return textResult("Missing required arguments: webhook_id and id", true);
1021
+ return textResult(await client.webhooks.deliveries.get(webhookId, id));
1022
+ }
1023
+ case "resend_webhook_delivery": {
1024
+ const webhookId = optString(args, "webhook_id");
1025
+ const id = optString(args, "id");
1026
+ if (!webhookId || !id) return textResult("Missing required arguments: webhook_id and id", true);
1027
+ return textResult(await client.webhooks.deliveries.resend(webhookId, id));
1028
+ }
968
1029
  case "create_webhook": {
969
1030
  const url = optString(args, "url");
970
1031
  if (!url) return textResult("Missing required argument: url", true);
@@ -1582,6 +1643,58 @@ var MCP_TOOLS = [
1582
1643
  outputSchema: pagedOutput("webhooks", webhookItem, "Webhook endpoints on this page"),
1583
1644
  annotations: readOnly("List webhooks")
1584
1645
  },
1646
+ {
1647
+ name: "list_webhook_deliveries",
1648
+ description: "List the delivery log of one webhook endpoint, newest first: every event sent to it in the last 30 days with its status, attempts and response. Use it to find failed deliveries.",
1649
+ inputSchema: {
1650
+ type: "object",
1651
+ properties: {
1652
+ webhook_id: { type: "string", description: "Webhook id" },
1653
+ status: { type: "string", enum: ["pending", "retrying", "delivered", "failed"], description: "Only this status" },
1654
+ event: { type: "string", description: "Only this event type, for example email.delivered" },
1655
+ email_id: { type: "string", description: "Only deliveries for this email" },
1656
+ q: { type: "string", description: "An exact email id, or part of a recipient address" },
1657
+ ...paginationProps
1658
+ },
1659
+ required: ["webhook_id"]
1660
+ },
1661
+ outputSchema: pagedOutput("deliveries", webhookDeliveryItem, "Deliveries on this page"),
1662
+ annotations: readOnly("List webhook deliveries")
1663
+ },
1664
+ {
1665
+ name: "get_webhook_delivery",
1666
+ description: "Get one webhook delivery: every attempt with its status code and latency, the payload sent, and what the endpoint replied (first 2 KB).",
1667
+ inputSchema: {
1668
+ type: "object",
1669
+ properties: {
1670
+ webhook_id: { type: "string", description: "Webhook id" },
1671
+ id: { type: "string", description: "Delivery id" }
1672
+ },
1673
+ required: ["webhook_id", "id"]
1674
+ },
1675
+ outputSchema: webhookDeliveryOutput,
1676
+ annotations: readOnly("Get webhook delivery")
1677
+ },
1678
+ {
1679
+ name: "resend_webhook_delivery",
1680
+ description: "Send a delivery again: the same payload as a new delivery, signed afresh, with the usual retries. The original stays as it was. The endpoint must be turned on; limited to 30 resends a minute.",
1681
+ inputSchema: {
1682
+ type: "object",
1683
+ properties: {
1684
+ webhook_id: { type: "string", description: "Webhook id" },
1685
+ id: { type: "string", description: "Delivery id to resend" }
1686
+ },
1687
+ required: ["webhook_id", "id"]
1688
+ },
1689
+ outputSchema: webhookDeliveryOutput,
1690
+ annotations: {
1691
+ title: "Resend webhook delivery",
1692
+ readOnlyHint: false,
1693
+ destructiveHint: false,
1694
+ idempotentHint: false,
1695
+ openWorldHint: true
1696
+ }
1697
+ },
1585
1698
  {
1586
1699
  name: "create_webhook",
1587
1700
  description: "Create a webhook endpoint. Returns the endpoint plus a signing secret (shown once).",
@@ -2188,7 +2301,7 @@ function resolveApiKey() {
2188
2301
  }
2189
2302
 
2190
2303
  // src/server.ts
2191
- var MCP_SERVER_VERSION = "0.24.0";
2304
+ var MCP_SERVER_VERSION = "0.25.0";
2192
2305
  var MCP_SERVER_INSTRUCTIONS = [
2193
2306
  "Groundmail sends transactional email from domains the user has verified.",
2194
2307
  'To test before a domain is verified, call send_email with from "noreply@mail.groundmail.dev" and to set to the Groundmail account email; sandbox sends to any other address are rejected.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "groundmail-mcp",
3
- "version": "0.24.0",
3
+ "version": "0.25.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.32.2",
44
- "groundmail": "0.38.0"
44
+ "groundmail": "0.39.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "tsup": "^8.5.0",