{
  "schema_version": 1,
  "server": {
    "name": "sendhq",
    "command": "sendhq mcp",
    "transport": "stdio"
  },
  "excluded": [
    {
      "capability": "Create, rotate, revoke, or delete API keys",
      "endpoints": [
        "POST /keys",
        "DELETE /keys/:id"
      ],
      "reason": "Deliberately excluded: an agent must not mint or destroy credentials. Keys are managed by a human in the dashboard."
    },
    {
      "capability": "Start a checkout or cancel a subscription",
      "endpoints": [
        "POST /billing/checkout",
        "POST /billing/cancel"
      ],
      "reason": "Billing changes are session-only by design and require the account owner in the dashboard. Billing state is readable with get_account."
    },
    {
      "capability": "Cloudflare one-click DNS (OAuth)",
      "endpoints": [
        "GET /api/dns/cloudflare/connect"
      ],
      "reason": "Requires an interactive browser session and Cloudflare OAuth consent. Use get_domain records, get_dns_provider hosts, or get_domain_connect_link instead."
    },
    {
      "capability": "Sign up, log in, log out, Google account linking",
      "endpoints": [
        "/api/auth/*"
      ],
      "reason": "Human browser authentication; the MCP server authenticates with an API key."
    },
    {
      "capability": "Contact support form",
      "endpoints": [
        "POST /api/contact"
      ],
      "reason": "Public marketing-site form for humans, not a workspace operation."
    },
    {
      "capability": "Webhook endpoints and deliveries",
      "endpoints": [
        "GET /webhooks",
        "POST /webhooks",
        "GET /webhooks/:id",
        "PATCH /webhooks/:id",
        "DELETE /webhooks/:id",
        "POST /webhooks/:id/rotate-secret",
        "POST /webhooks/:id/test",
        "GET /webhooks/:id/deliveries",
        "GET /webhooks/:id/deliveries/:deliveryId",
        "POST /webhooks/:id/deliveries/:deliveryId/retry"
      ],
      "reason": "Webhook endpoints are configured once by a human, in the dashboard or the REST API, and their responses carry signing secrets an agent should not hold. An agent reads the same outcomes with list_email_events, list_emails, and list_blocked_recipients."
    },
    {
      "capability": "Upload editor images and export contacts as CSV",
      "endpoints": [
        "POST /uploads/images",
        "GET /contacts/export"
      ],
      "reason": "Image uploads take a raw binary body and the export returns a CSV file meant for a person to download. Agents reuse uploaded images with list_uploaded_images and read the same contacts, filters, tags, and fields as JSON with list_contacts (paginated)."
    }
  ],
  "tools": [
    {
      "name": "send_email",
      "title": "Send one email",
      "group": "emails",
      "description": "SENDS REAL EMAIL. Send one message from a verified domain: raw html/text, a published hosted template, a reply in an existing thread, or a message with attachments. Pass `idempotency_key` so a retry cannot send twice; a retry must reuse the same key AND an identical request, otherwise SendHQ returns 409. `attachments` is a convenience that creates a draft, uploads each file, and sends with that draft; it cannot be combined with `idempotency_key` or `draft_id` (use create_draft + upload_attachment + send_email with draft_id for retry-safe attachment sends). Unpaid workspaces (integration trial) can deliver only to the account email or a mailbox-simulator test address, and cannot send attachments.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": true,
        "title": "Send one email"
      },
      "sends_email": true,
      "inputSchema": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "description": "Sender, e.g. `Acme <hello@example.com>`. The domain must be verified in this workspace (see list_sending_identities).",
            "minLength": 3,
            "maxLength": 998
          },
          "to": {
            "type": "array",
            "description": "Recipients. Each entry is an address, optionally with a display name. To+cc+bcc may total at most 100; every destination consumes one delivery credit.",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 320
            },
            "minItems": 1,
            "maxItems": 100
          },
          "cc": {
            "type": "array",
            "description": "Carbon-copy recipients.",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 320
            },
            "minItems": 0,
            "maxItems": 100
          },
          "bcc": {
            "type": "array",
            "description": "Blind-copy recipients.",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 320
            },
            "minItems": 0,
            "maxItems": 100
          },
          "subject": {
            "type": "string",
            "description": "Subject line. Omit when sending a template.",
            "maxLength": 998
          },
          "text": {
            "type": "string",
            "description": "Plain-text body. Provide text, html, or template."
          },
          "html": {
            "type": "string",
            "description": "HTML body. SendHQ sanitizes it and derives text when `text` is omitted."
          },
          "reply_to": {
            "type": "string",
            "description": "Reply-To address."
          },
          "headers": {
            "type": "object",
            "description": "Extra safe custom headers (string values), e.g. {\"X-Entity-Ref-ID\": \"123\"}. Routing headers such as From/To/Message-ID are controlled by SendHQ.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "message_class": {
            "type": "string",
            "description": "`transactional` (default) or `marketing`. Marketing requires a marketing-enabled plan or domain and adds unsubscribe handling.",
            "enum": [
              "transactional",
              "marketing"
            ]
          },
          "reply_to_email_id": {
            "type": "string",
            "description": "Reply inside an existing conversation: the `em_…` ID of the message being answered. SendHQ sets In-Reply-To/References and the thread."
          },
          "thread_id": {
            "type": "string",
            "description": "Explicit thread ID to file the message under."
          },
          "draft_id": {
            "type": "string",
            "description": "Send a stored draft's attachments with this message (`dr_…`). The draft is deleted after a successful send."
          },
          "template": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Template ID (`tmpl_…`). Provide `id` or `key`."
              },
              "key": {
                "type": "string",
                "description": "Template key such as `account-welcome`. Provide `id` or `key`."
              },
              "version_id": {
                "type": "string",
                "description": "Optional published release ID (`tmplv_…`). Defaults to the current published release."
              },
              "data": {
                "type": "object",
                "description": "Values for the template's typed variables.",
                "additionalProperties": true
              }
            },
            "additionalProperties": false,
            "anyOf": [
              {
                "required": [
                  "id"
                ]
              },
              {
                "required": [
                  "key"
                ]
              }
            ],
            "description": "Send a published hosted template instead of raw html/text. Requires exactly one `to` recipient and no cc/bcc; the template supplies the subject."
          },
          "labels": {
            "type": "array",
            "description": "Label names or `lbl_…` IDs to file this message under. Unknown names are created. Replies in the conversation inherit the labels, and a bucket label (`skip_inbox`) keeps those replies out of the Inbox. Max 10.",
            "maxItems": 10,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "idempotency_key": {
            "type": "string",
            "description": "Idempotency-Key header (max 200 chars). Reuse it only to retry this exact request.",
            "minLength": 1,
            "maxLength": 200
          },
          "attachments": {
            "type": "array",
            "maxItems": 10,
            "description": "Files to attach (max 10 files, 10 MB total). Each needs `content_base64` (plus `filename`) or a local `file_path`.",
            "items": {
              "type": "object",
              "properties": {
                "filename": {
                  "type": "string",
                  "description": "File name shown to the recipient. Required with content_base64; defaults to the basename of file_path.",
                  "minLength": 1,
                  "maxLength": 255
                },
                "content_type": {
                  "type": "string",
                  "description": "MIME type, e.g. `application/pdf`. Defaults to `application/octet-stream`."
                },
                "content_base64": {
                  "type": "string",
                  "description": "Standard base64 file content."
                },
                "file_path": {
                  "type": "string",
                  "description": "Absolute path of a local file readable by the MCP server process."
                }
              },
              "additionalProperties": false,
              "anyOf": [
                {
                  "required": [
                    "content_base64"
                  ]
                },
                {
                  "required": [
                    "file_path"
                  ]
                }
              ]
            }
          }
        },
        "additionalProperties": false,
        "required": [
          "from",
          "to"
        ],
        "anyOf": [
          {
            "required": [
              "html"
            ]
          },
          {
            "required": [
              "text"
            ]
          },
          {
            "required": [
              "template"
            ]
          }
        ]
      },
      "returns": "{id: `em_…`, providerMessageId, threadId, templateId, templateVersionId, isTest}. Acceptance is not delivery: follow up with list_email_events.",
      "example": {
        "from": "Acme <hello@example.com>",
        "to": [
          "owner@example.com"
        ],
        "subject": "Your export is ready",
        "text": "Download it from your dashboard.",
        "idempotency_key": "export-ready-42"
      },
      "http": {
        "method": "POST",
        "path": "/emails",
        "body": "args",
        "idempotency": true
      },
      "handler": "send_email"
    },
    {
      "name": "send_batch",
      "title": "Send a batch of individualized emails",
      "group": "emails",
      "description": "SENDS REAL EMAIL. Send 1–100 independent messages in one request (use this for per-recipient template personalization). Each item has the same shape as send_email (without attachments/idempotency_key). Items succeed or fail individually: HTTP 207 means partial success; inspect each `data[i].ok` and `data[i].error`. One `idempotency_key` covers the whole batch body.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": true,
        "title": "Send a batch of individualized emails"
      },
      "sends_email": true,
      "inputSchema": {
        "type": "object",
        "properties": {
          "emails": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "object",
              "properties": {
                "from": {
                  "type": "string",
                  "description": "Sender, e.g. `Acme <hello@example.com>`. The domain must be verified in this workspace (see list_sending_identities).",
                  "minLength": 3,
                  "maxLength": 998
                },
                "to": {
                  "type": "array",
                  "description": "Recipients. Each entry is an address, optionally with a display name. To+cc+bcc may total at most 100; every destination consumes one delivery credit.",
                  "items": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 320
                  },
                  "minItems": 1,
                  "maxItems": 100
                },
                "cc": {
                  "type": "array",
                  "description": "Carbon-copy recipients.",
                  "items": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 320
                  },
                  "minItems": 0,
                  "maxItems": 100
                },
                "bcc": {
                  "type": "array",
                  "description": "Blind-copy recipients.",
                  "items": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 320
                  },
                  "minItems": 0,
                  "maxItems": 100
                },
                "subject": {
                  "type": "string",
                  "description": "Subject line. Omit when sending a template.",
                  "maxLength": 998
                },
                "text": {
                  "type": "string",
                  "description": "Plain-text body. Provide text, html, or template."
                },
                "html": {
                  "type": "string",
                  "description": "HTML body. SendHQ sanitizes it and derives text when `text` is omitted."
                },
                "reply_to": {
                  "type": "string",
                  "description": "Reply-To address."
                },
                "headers": {
                  "type": "object",
                  "description": "Extra safe custom headers (string values), e.g. {\"X-Entity-Ref-ID\": \"123\"}. Routing headers such as From/To/Message-ID are controlled by SendHQ.",
                  "additionalProperties": {
                    "type": "string"
                  }
                },
                "message_class": {
                  "type": "string",
                  "description": "`transactional` (default) or `marketing`. Marketing requires a marketing-enabled plan or domain and adds unsubscribe handling.",
                  "enum": [
                    "transactional",
                    "marketing"
                  ]
                },
                "reply_to_email_id": {
                  "type": "string",
                  "description": "Reply inside an existing conversation: the `em_…` ID of the message being answered. SendHQ sets In-Reply-To/References and the thread."
                },
                "thread_id": {
                  "type": "string",
                  "description": "Explicit thread ID to file the message under."
                },
                "draft_id": {
                  "type": "string",
                  "description": "Send a stored draft's attachments with this message (`dr_…`). The draft is deleted after a successful send."
                },
                "template": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Template ID (`tmpl_…`). Provide `id` or `key`."
                    },
                    "key": {
                      "type": "string",
                      "description": "Template key such as `account-welcome`. Provide `id` or `key`."
                    },
                    "version_id": {
                      "type": "string",
                      "description": "Optional published release ID (`tmplv_…`). Defaults to the current published release."
                    },
                    "data": {
                      "type": "object",
                      "description": "Values for the template's typed variables.",
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": false,
                  "anyOf": [
                    {
                      "required": [
                        "id"
                      ]
                    },
                    {
                      "required": [
                        "key"
                      ]
                    }
                  ],
                  "description": "Send a published hosted template instead of raw html/text. Requires exactly one `to` recipient and no cc/bcc; the template supplies the subject."
                },
                "labels": {
                  "type": "array",
                  "description": "Label names or `lbl_…` IDs to file this message under. Unknown names are created. Replies in the conversation inherit the labels, and a bucket label (`skip_inbox`) keeps those replies out of the Inbox. Max 10.",
                  "maxItems": 10,
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  }
                }
              },
              "additionalProperties": false,
              "required": [
                "from",
                "to"
              ],
              "anyOf": [
                {
                  "required": [
                    "html"
                  ]
                },
                {
                  "required": [
                    "text"
                  ]
                },
                {
                  "required": [
                    "template"
                  ]
                }
              ]
            },
            "description": "Messages to send."
          },
          "idempotency_key": {
            "type": "string",
            "description": "Idempotency-Key for the entire batch (max 200 chars).",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "additionalProperties": false,
        "required": [
          "emails"
        ]
      },
      "returns": "{data: [{index, ok, id?, error?: {message, status}}], count, successful, failed}.",
      "example": {
        "emails": [
          {
            "from": "Acme <hello@example.com>",
            "to": [
              "owner@example.com"
            ],
            "template": {
              "key": "account-welcome",
              "data": {
                "first_name": "Asha"
              }
            }
          }
        ],
        "idempotency_key": "welcome-batch-2026-09-26"
      },
      "http": {
        "method": "POST",
        "path": "/emails/batch",
        "body": [
          "emails"
        ],
        "idempotency": true
      }
    },
    {
      "name": "list_emails",
      "title": "List and search email",
      "group": "emails",
      "description": "List sent (`direction: out`) and received (`direction: in`) email newest-first with filters. Received mail is classified: read the human inbox with `direction: in`, `archived: false`, `category: primary`; triage with `important: true`; spam is hidden unless `category: spam` or `include_spam: true`. Paginated: the result includes `pagination` {offset, limit, returned, total?, has_more, next_offset}.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "List and search email"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "direction": {
            "type": "string",
            "description": "`in` for received, `out` for sent.",
            "enum": [
              "in",
              "out"
            ]
          },
          "status": {
            "type": "string",
            "description": "Status filter, e.g. `queued`, `sent`, `delivered`, `bounced`, `complained`, `failed`."
          },
          "domain": {
            "type": "string",
            "description": "Only messages for this domain, or a comma-separated list of domains (matches any)."
          },
          "inbox_id": {
            "type": "string",
            "description": "Only messages received by this inbox (`inb_…`)."
          },
          "label": {
            "type": "string",
            "description": "Only messages carrying this label: a label ID `lbl_…` or exact name, or a comma-separated list (matches any). Use list_labels to see folders."
          },
          "archived": {
            "type": "boolean",
            "description": "false = the Inbox view (received mail not archived), true = archived only. Omit for all mail."
          },
          "category": {
            "type": "string",
            "description": "`primary` (people), `updates` (newsletters, bulk, automated), or `spam`; or a comma-separated list. Spam is hidden unless requested."
          },
          "important": {
            "type": "boolean",
            "description": "true = only messages flagged important (replies to conversations you started, and senders marked important)."
          },
          "include_spam": {
            "type": "boolean",
            "description": "Include spam in the results (for searches across every folder)."
          },
          "from": {
            "type": "string",
            "description": "Sender address contains this value."
          },
          "to": {
            "type": "string",
            "description": "Recipient address contains this value."
          },
          "unread": {
            "type": "boolean",
            "description": "true = unread only, false = read only."
          },
          "after": {
            "type": "string",
            "description": "ISO-8601 timestamp; only messages created after it.",
            "format": "date-time"
          },
          "before": {
            "type": "string",
            "description": "ISO-8601 timestamp; only messages created before it.",
            "format": "date-time"
          },
          "query": {
            "type": "string",
            "description": "Free-text search over subjects, bodies, sender/recipient addresses, and attachment filenames.",
            "maxLength": 200
          },
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false
      },
      "returns": "{data: [email summaries], count, pagination}.",
      "example": {
        "direction": "in",
        "unread": true,
        "limit": 25
      },
      "http": {
        "method": "GET",
        "path": "/emails",
        "query": [
          "direction",
          "status",
          "domain",
          "inbox_id",
          "label",
          "archived",
          "category",
          "important",
          "include_spam",
          "from",
          "to",
          "unread",
          "after",
          "before",
          "query",
          "limit",
          "offset"
        ],
        "pagination": "server"
      }
    },
    {
      "name": "get_email",
      "title": "Get one email",
      "group": "emails",
      "description": "Retrieve one message with headers, html/text body, status, thread metadata, and attachment metadata (download bytes with download_attachment).",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Get one email"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "email_id": {
            "type": "string",
            "description": "Email ID (starts with `em_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "email_id"
        ]
      },
      "returns": "Email object: {id, direction, status, from, to, cc, bcc, subject, html, text, threadId, messageId, providerMessageId, readAt, createdAt, attachments: [{id, filename, contentType, sizeBytes, available}]}.",
      "example": {
        "email_id": "em_123"
      },
      "http": {
        "method": "GET",
        "path": "/emails/{email_id}"
      }
    },
    {
      "name": "mark_email",
      "title": "Mark read, archived, spam, or important",
      "group": "emails",
      "description": "Update one message: `read`, `archived`, `category` (`primary`, `updates`, `spam`; received mail only), and `important`. Reporting spam or marking important teaches SendHQ about that sender for future mail; pass `learn: false` to change only this message. Pass at least one field.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Mark read, archived, spam, or important"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "email_id": {
            "type": "string",
            "description": "Email ID (starts with `em_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          },
          "read": {
            "type": "boolean",
            "description": "true = read, false = unread."
          },
          "archived": {
            "type": "boolean",
            "description": "true = archive (skip the Inbox), false = move back to the Inbox."
          },
          "category": {
            "type": "string",
            "enum": [
              "primary",
              "updates",
              "spam"
            ],
            "description": "Move a received message to primary, updates, or spam."
          },
          "important": {
            "type": "boolean",
            "description": "Flag or unflag the message as important."
          },
          "learn": {
            "type": "boolean",
            "description": "false = do not remember this verdict for the sender (default true)."
          }
        },
        "additionalProperties": false,
        "required": [
          "email_id"
        ]
      },
      "returns": "The updated email object.",
      "example": {
        "email_id": "em_123",
        "read": true
      },
      "http": {
        "method": "PATCH",
        "path": "/emails/{email_id}",
        "body": [
          "read",
          "archived",
          "category",
          "important",
          "learn"
        ]
      }
    },
    {
      "name": "delete_email",
      "title": "Delete an email",
      "group": "emails",
      "description": "DESTRUCTIVE: permanently delete a retained message and its stored attachments from SendHQ. It does not recall a message that was already delivered.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Delete an email"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "email_id": {
            "type": "string",
            "description": "Email ID (starts with `em_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "email_id"
        ]
      },
      "returns": "{ok: true}.",
      "example": {
        "email_id": "em_123"
      },
      "http": {
        "method": "DELETE",
        "path": "/emails/{email_id}"
      }
    },
    {
      "name": "list_email_events",
      "title": "List delivery events for an email",
      "group": "emails",
      "description": "Provider events for one sent message: delivery, bounce, complaint, reject, open, click. This is the evidence for whether a message was delivered or why it failed. Paginated: the result includes `pagination` {offset, limit, returned, total?, has_more, next_offset}.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "List delivery events for an email"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "email_id": {
            "type": "string",
            "description": "Email ID (starts with `em_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          },
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false,
        "required": [
          "email_id"
        ]
      },
      "returns": "{data: [{event_type, recipient, reason, created_at, …}], count, pagination}.",
      "example": {
        "email_id": "em_123"
      },
      "http": {
        "method": "GET",
        "path": "/emails/{email_id}/events",
        "pagination": "client"
      }
    },
    {
      "name": "get_thread",
      "title": "Get a conversation",
      "group": "emails",
      "description": "Retrieve every message in a conversation in chronological order (sent and received), each with attachment metadata.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Get a conversation"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "thread_id": {
            "type": "string",
            "description": "Thread ID (usually the `em_…` ID of the first message; see `threadId` on any email).",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "thread_id"
        ]
      },
      "returns": "{id, subject, data: [emails]}.",
      "example": {
        "thread_id": "em_123"
      },
      "http": {
        "method": "GET",
        "path": "/threads/{thread_id}"
      }
    },
    {
      "name": "list_labels",
      "title": "List labels",
      "group": "labels",
      "description": "List the workspace's labels (folders) with total and unread counts and their auto-filing rules. Paginated: the result includes `pagination` {offset, limit, returned, total?, has_more, next_offset}.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "List labels"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false
      },
      "returns": "{data: [{id, name, color, totalCount, unreadCount, rules: [...]}], count, pagination}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/labels",
        "pagination": "client"
      }
    },
    {
      "name": "get_label",
      "title": "Get a label",
      "group": "labels",
      "description": "Retrieve one label with counts and auto-filing rules.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Get a label"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "label_id": {
            "type": "string",
            "description": "Label ID (starts with `lbl_`) or the exact label name.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "label_id"
        ]
      },
      "returns": "Label object.",
      "example": {
        "label_id": "Billing"
      },
      "http": {
        "method": "GET",
        "path": "/labels/{label_id}"
      }
    },
    {
      "name": "create_label",
      "title": "Create a label",
      "group": "labels",
      "description": "Create a folder-style label. Set `skip_inbox: true` to make it a bucket an agent owns: send with `labels: [name]` and the replies are filed into the label and kept out of the Inbox. Optional auto-filing rules file new sent/received mail (every condition on a rule must match). Set `apply_to_existing` to also file retained mail.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Create a label"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Label name, e.g. `Billing` or `Clients/Acme`. Unique per workspace (case-insensitive).",
            "minLength": 1,
            "maxLength": 64
          },
          "color": {
            "type": "string",
            "description": "Hex color such as `#1a73e8`. Optional."
          },
          "skip_inbox": {
            "type": "boolean",
            "description": "Bucket mode: received mail that gets this label (by rule, by replying to a conversation sent with this label, or by hand) is archived so it appears only in the label, not the Inbox."
          },
          "rules": {
            "type": "array",
            "description": "Optional auto-filing rules (max 20). Each needs at least one of inbox_id, from, to, subject.",
            "maxItems": 20,
            "items": {
              "type": "object",
              "properties": {
                "direction": {
                  "type": "string",
                  "description": "Only `in` (received) or `out` (sent) mail. Omit for both.",
                  "enum": [
                    "in",
                    "out"
                  ]
                },
                "inbox_id": {
                  "type": "string",
                  "description": "Only mail received by this inbox (`inb_…`). Files each receiving address into its own folder."
                },
                "from": {
                  "type": "string",
                  "description": "Sender contains this text (case-insensitive), e.g. `@stripe.com`.",
                  "maxLength": 200
                },
                "to": {
                  "type": "string",
                  "description": "To/Cc contains this text (case-insensitive).",
                  "maxLength": 200
                },
                "subject": {
                  "type": "string",
                  "description": "Subject contains this text (case-insensitive).",
                  "maxLength": 200
                },
                "skip_inbox": {
                  "type": "boolean",
                  "description": "Archive matching received mail so it appears only in the label folder, not the Inbox."
                }
              },
              "additionalProperties": false
            }
          },
          "apply_to_existing": {
            "type": "boolean",
            "description": "Also file already-retained mail that matches the rules."
          }
        },
        "additionalProperties": false,
        "required": [
          "name"
        ]
      },
      "returns": "The created label with rules.",
      "example": {
        "name": "Agent/Orders",
        "skip_inbox": true,
        "rules": [
          {
            "from": "@stripe.com"
          }
        ]
      },
      "http": {
        "method": "POST",
        "path": "/labels",
        "body": [
          "name",
          "color",
          "skip_inbox",
          "rules",
          "apply_to_existing"
        ]
      }
    },
    {
      "name": "update_label",
      "title": "Rename, recolor, or bucket a label",
      "group": "labels",
      "description": "Rename a label, change its color, or toggle bucket mode (`skip_inbox`). Turning bucket mode on archives received mail already in the label.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Rename, recolor, or bucket a label"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "label_id": {
            "type": "string",
            "description": "Label ID (starts with `lbl_`) or the exact label name.",
            "minLength": 1,
            "maxLength": 128
          },
          "name": {
            "type": "string",
            "description": "New name.",
            "minLength": 1,
            "maxLength": 64
          },
          "color": {
            "type": "string",
            "description": "New hex color."
          },
          "skip_inbox": {
            "type": "boolean",
            "description": "Bucket mode: received mail that gets this label (by rule, by replying to a conversation sent with this label, or by hand) is archived so it appears only in the label, not the Inbox."
          }
        },
        "additionalProperties": false,
        "required": [
          "label_id"
        ]
      },
      "returns": "Updated label.",
      "example": {
        "label_id": "lbl_123",
        "name": "Finance/Billing"
      },
      "http": {
        "method": "PATCH",
        "path": "/labels/{label_id}",
        "body": [
          "name",
          "color",
          "skip_inbox"
        ]
      }
    },
    {
      "name": "delete_label",
      "title": "Delete a label",
      "group": "labels",
      "description": "DESTRUCTIVE: delete a label and its rules. The email itself is kept; it only loses this label.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Delete a label"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "label_id": {
            "type": "string",
            "description": "Label ID (starts with `lbl_`) or the exact label name.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "label_id"
        ]
      },
      "returns": "{ok: true}.",
      "example": {
        "label_id": "lbl_123"
      },
      "http": {
        "method": "DELETE",
        "path": "/labels/{label_id}"
      }
    },
    {
      "name": "create_label_rule",
      "title": "Add an auto-filing rule",
      "group": "labels",
      "description": "Add a rule to a label so matching new mail is filed automatically. Every condition you set must match. Use `inbox_id` to give a receiving address its own folder; add `skip_inbox` to keep it out of the Inbox.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Add an auto-filing rule"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "label_id": {
            "type": "string",
            "description": "Label ID (starts with `lbl_`) or the exact label name.",
            "minLength": 1,
            "maxLength": 128
          },
          "direction": {
            "type": "string",
            "description": "Only `in` (received) or `out` (sent) mail. Omit for both.",
            "enum": [
              "in",
              "out"
            ]
          },
          "inbox_id": {
            "type": "string",
            "description": "Only mail received by this inbox (`inb_…`). Files each receiving address into its own folder."
          },
          "from": {
            "type": "string",
            "description": "Sender contains this text (case-insensitive), e.g. `@stripe.com`.",
            "maxLength": 200
          },
          "to": {
            "type": "string",
            "description": "To/Cc contains this text (case-insensitive).",
            "maxLength": 200
          },
          "subject": {
            "type": "string",
            "description": "Subject contains this text (case-insensitive).",
            "maxLength": 200
          },
          "skip_inbox": {
            "type": "boolean",
            "description": "Archive matching received mail so it appears only in the label folder, not the Inbox."
          },
          "apply_to_existing": {
            "type": "boolean",
            "description": "Also file already-retained mail that matches."
          }
        },
        "additionalProperties": false,
        "required": [
          "label_id"
        ]
      },
      "returns": "{id: `lrule_…`, labelId, direction, inboxId, from, to, subject, skipInbox}.",
      "example": {
        "label_id": "Billing",
        "inbox_id": "inb_123",
        "skip_inbox": true
      },
      "http": {
        "method": "POST",
        "path": "/labels/{label_id}/rules",
        "body": [
          "direction",
          "inbox_id",
          "from",
          "to",
          "subject",
          "skip_inbox",
          "apply_to_existing"
        ]
      }
    },
    {
      "name": "delete_label_rule",
      "title": "Delete an auto-filing rule",
      "group": "labels",
      "description": "DESTRUCTIVE: remove one auto-filing rule. Mail already filed keeps its label.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Delete an auto-filing rule"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "label_id": {
            "type": "string",
            "description": "Label ID (starts with `lbl_`) or the exact label name.",
            "minLength": 1,
            "maxLength": 128
          },
          "rule_id": {
            "type": "string",
            "description": "Rule ID (starts with `lrule_`), from get_label.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "label_id",
          "rule_id"
        ]
      },
      "returns": "{ok: true}.",
      "example": {
        "label_id": "lbl_123",
        "rule_id": "lrule_123"
      },
      "http": {
        "method": "DELETE",
        "path": "/labels/{label_id}/rules/{rule_id}"
      }
    },
    {
      "name": "label_email",
      "title": "Add or remove labels on an email",
      "group": "labels",
      "description": "Move a message between folders: add and/or remove labels by name or `lbl_…` ID. Unknown names in `add` are created unless `create` is false.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Add or remove labels on an email"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "email_id": {
            "type": "string",
            "description": "Email ID (starts with `em_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          },
          "add": {
            "type": "array",
            "description": "Labels to add.",
            "maxItems": 10,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "remove": {
            "type": "array",
            "description": "Labels to remove.",
            "maxItems": 10,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "create": {
            "type": "boolean",
            "description": "Create unknown labels in `add` (default true)."
          }
        },
        "additionalProperties": false,
        "required": [
          "email_id"
        ]
      },
      "returns": "The updated email with `labels`.",
      "example": {
        "email_id": "em_123",
        "add": [
          "Billing"
        ],
        "remove": [
          "Support"
        ]
      },
      "http": {
        "method": "POST",
        "path": "/emails/{email_id}/labels",
        "body": [
          "add",
          "remove",
          "create"
        ]
      }
    },
    {
      "name": "list_sending_identities",
      "title": "List verified sender identities",
      "group": "drafts",
      "description": "Addresses and domains this workspace can send from right now (verified domains, their default From, and active inbox addresses). Call before send_email to pick a valid `from`.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "List verified sender identities"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "returns": "{domains: [verified domain names], addresses: [sender addresses], localParts: [...]}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/sending-identities"
      }
    },
    {
      "name": "create_draft",
      "title": "Create a draft",
      "group": "drafts",
      "description": "Create a composer draft. Drafts hold attachments: create a draft, upload_attachment, then send_email with `draft_id`. Does not send anything.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Create a draft"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "description": "Sender address on a verified domain (may be empty while drafting)."
          },
          "to": {
            "type": "array",
            "description": "Recipients.",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 320
            },
            "minItems": 0,
            "maxItems": 100
          },
          "cc": {
            "type": "array",
            "description": "Carbon-copy recipients.",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 320
            },
            "minItems": 0,
            "maxItems": 100
          },
          "bcc": {
            "type": "array",
            "description": "Blind-copy recipients.",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 320
            },
            "minItems": 0,
            "maxItems": 100
          },
          "subject": {
            "type": "string",
            "description": "Subject line.",
            "maxLength": 998
          },
          "html": {
            "type": "string",
            "description": "HTML body."
          },
          "text": {
            "type": "string",
            "description": "Plain-text body."
          },
          "reply_to_email_id": {
            "type": "string",
            "description": "Email ID this draft replies to."
          },
          "thread_id": {
            "type": "string",
            "description": "Thread ID this draft belongs to."
          }
        },
        "additionalProperties": false
      },
      "returns": "Draft object {id: `dr_…`, from, to, cc, bcc, subject, html, text, attachments: []}.",
      "example": {
        "from": "hello@example.com",
        "to": [
          "owner@example.com"
        ],
        "subject": "Invoice"
      },
      "http": {
        "method": "POST",
        "path": "/drafts",
        "body": [
          "from",
          "to",
          "cc",
          "bcc",
          "subject",
          "html",
          "text",
          "reply_to_email_id",
          "thread_id"
        ]
      }
    },
    {
      "name": "list_drafts",
      "title": "List drafts",
      "group": "drafts",
      "description": "List composer drafts, most recently updated first. Paginated: the result includes `pagination` {offset, limit, returned, total?, has_more, next_offset}.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "List drafts"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false
      },
      "returns": "{data: [drafts], count, pagination}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/drafts",
        "pagination": "client"
      }
    },
    {
      "name": "get_draft",
      "title": "Get a draft",
      "group": "drafts",
      "description": "Retrieve one draft with its attachment metadata.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Get a draft"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "draft_id": {
            "type": "string",
            "description": "Draft ID (starts with `dr_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "draft_id"
        ]
      },
      "returns": "Draft object with `attachments`.",
      "example": {
        "draft_id": "dr_123"
      },
      "http": {
        "method": "GET",
        "path": "/drafts/{draft_id}"
      }
    },
    {
      "name": "update_draft",
      "title": "Replace draft content",
      "group": "drafts",
      "description": "Replace a draft's content and recipients. This is a full replacement: fields you omit are cleared, so read get_draft first and send every field you want to keep. Attachments are unaffected.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Replace draft content"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "draft_id": {
            "type": "string",
            "description": "Draft ID (starts with `dr_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          },
          "from": {
            "type": "string",
            "description": "Sender address on a verified domain (may be empty while drafting)."
          },
          "to": {
            "type": "array",
            "description": "Recipients.",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 320
            },
            "minItems": 0,
            "maxItems": 100
          },
          "cc": {
            "type": "array",
            "description": "Carbon-copy recipients.",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 320
            },
            "minItems": 0,
            "maxItems": 100
          },
          "bcc": {
            "type": "array",
            "description": "Blind-copy recipients.",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 320
            },
            "minItems": 0,
            "maxItems": 100
          },
          "subject": {
            "type": "string",
            "description": "Subject line.",
            "maxLength": 998
          },
          "html": {
            "type": "string",
            "description": "HTML body."
          },
          "text": {
            "type": "string",
            "description": "Plain-text body."
          },
          "reply_to_email_id": {
            "type": "string",
            "description": "Email ID this draft replies to."
          },
          "thread_id": {
            "type": "string",
            "description": "Thread ID this draft belongs to."
          }
        },
        "additionalProperties": false,
        "required": [
          "draft_id"
        ]
      },
      "returns": "Updated draft object.",
      "example": {
        "draft_id": "dr_123",
        "from": "hello@example.com",
        "to": [
          "owner@example.com"
        ],
        "subject": "Invoice (updated)",
        "text": "Attached."
      },
      "http": {
        "method": "PUT",
        "path": "/drafts/{draft_id}",
        "body": [
          "from",
          "to",
          "cc",
          "bcc",
          "subject",
          "html",
          "text",
          "reply_to_email_id",
          "thread_id"
        ]
      }
    },
    {
      "name": "delete_draft",
      "title": "Discard a draft",
      "group": "drafts",
      "description": "DESTRUCTIVE: discard a draft and permanently delete its stored attachments.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Discard a draft"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "draft_id": {
            "type": "string",
            "description": "Draft ID (starts with `dr_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "draft_id"
        ]
      },
      "returns": "{ok: true}.",
      "example": {
        "draft_id": "dr_123"
      },
      "http": {
        "method": "DELETE",
        "path": "/drafts/{draft_id}"
      }
    },
    {
      "name": "upload_attachment",
      "title": "Upload an attachment to a draft",
      "group": "drafts",
      "description": "Upload one file to a draft (max 10 files and 10 MB total per message). Provide `content_base64` or a local `file_path`. Attachments require a paid plan at send time.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Upload an attachment to a draft"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "draft_id": {
            "type": "string",
            "description": "Draft ID (starts with `dr_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          },
          "filename": {
            "type": "string",
            "description": "File name shown to the recipient. Defaults to the basename of `file_path`.",
            "maxLength": 255
          },
          "content_type": {
            "type": "string",
            "description": "MIME type, e.g. `application/pdf`. Defaults to `application/octet-stream`."
          },
          "content_base64": {
            "type": "string",
            "description": "Standard base64 file content."
          },
          "file_path": {
            "type": "string",
            "description": "Absolute path of a local file readable by the MCP server process."
          }
        },
        "additionalProperties": false,
        "required": [
          "draft_id"
        ],
        "anyOf": [
          {
            "required": [
              "content_base64"
            ]
          },
          {
            "required": [
              "file_path"
            ]
          }
        ]
      },
      "returns": "{id: `att_…`, filename, contentType, sizeBytes, available}.",
      "example": {
        "draft_id": "dr_123",
        "filename": "invoice.pdf",
        "content_type": "application/pdf",
        "file_path": "/tmp/invoice.pdf"
      },
      "http": {
        "method": "POST",
        "path": "/drafts/{draft_id}/attachments"
      },
      "handler": "upload_attachment"
    },
    {
      "name": "download_attachment",
      "title": "Download an attachment",
      "group": "drafts",
      "description": "Download a private attachment (sent, received, or draft). Returns base64 content, or writes the file when `save_to_path` is set (refuses to overwrite unless `overwrite` is true).",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Download an attachment"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "attachment_id": {
            "type": "string",
            "description": "Attachment ID (starts with `att_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          },
          "save_to_path": {
            "type": "string",
            "description": "Optional absolute local path to write the file to instead of returning base64."
          },
          "overwrite": {
            "type": "boolean",
            "description": "Allow replacing an existing file at save_to_path. Defaults to false."
          }
        },
        "additionalProperties": false,
        "required": [
          "attachment_id"
        ]
      },
      "returns": "{attachment_id, filename, content_type, size_bytes, content_base64} or {attachment_id, filename, content_type, size_bytes, saved_to}.",
      "example": {
        "attachment_id": "att_123",
        "save_to_path": "/tmp/invoice.pdf"
      },
      "http": {
        "method": "GET",
        "path": "/attachments/{attachment_id}"
      },
      "handler": "download_attachment"
    },
    {
      "name": "delete_attachment",
      "title": "Delete an attachment",
      "group": "drafts",
      "description": "DESTRUCTIVE: permanently delete a stored attachment (for example, remove a file from a draft before sending).",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Delete an attachment"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "attachment_id": {
            "type": "string",
            "description": "Attachment ID (starts with `att_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "attachment_id"
        ]
      },
      "returns": "{ok: true}.",
      "example": {
        "attachment_id": "att_123"
      },
      "http": {
        "method": "DELETE",
        "path": "/attachments/{attachment_id}"
      }
    },
    {
      "name": "list_templates",
      "title": "List hosted templates",
      "group": "templates",
      "description": "List hosted email templates with publish state and usage. Paginated: the result includes `pagination` {offset, limit, returned, total?, has_more, next_offset}.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "List hosted templates"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "lifecycle": {
            "type": "string",
            "description": "`active` (default), `archived`, or `all`.",
            "enum": [
              "active",
              "archived",
              "all"
            ]
          },
          "query": {
            "type": "string",
            "description": "Search by name or key.",
            "maxLength": 120
          },
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false
      },
      "returns": "{data: [templates], count, pagination}.",
      "example": {
        "lifecycle": "active"
      },
      "http": {
        "method": "GET",
        "path": "/templates",
        "query": [
          "lifecycle",
          "query"
        ],
        "pagination": "client"
      }
    },
    {
      "name": "create_template",
      "title": "Create a hosted template",
      "group": "templates",
      "description": "Create a template with an editable draft, optionally from a starter (`welcome`, `reset`, `receipt`, or `blank`). Publish it before sending by key.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Create a hosted template"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Human name.",
            "maxLength": 120
          },
          "key": {
            "type": "string",
            "description": "Stable send key: lowercase letters, numbers, hyphens; starts with a letter (2–64 chars). Derived from name when omitted.",
            "pattern": "^[a-z][a-z0-9-]{1,63}$"
          },
          "starter": {
            "type": "string",
            "description": "Starter content.",
            "enum": [
              "blank",
              "welcome",
              "reset",
              "receipt"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "name"
        ]
      },
      "returns": "{template, draft, activeVersion, versions, usage}.",
      "example": {
        "name": "Account welcome",
        "key": "account-welcome",
        "starter": "welcome"
      },
      "http": {
        "method": "POST",
        "path": "/templates",
        "body": [
          "name",
          "key",
          "starter"
        ]
      }
    },
    {
      "name": "get_template",
      "title": "Get a template",
      "group": "templates",
      "description": "Retrieve a template's current draft (with `revision`), active published release, release history, and usage. Accepts ID or key.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Get a template"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "template_id": {
            "type": "string",
            "description": "Template ID (`tmpl_…`) or key.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "template_id"
        ]
      },
      "returns": "{template, draft: {id, revision, subjectTemplate, htmlTemplate, textTemplate, variables, sampleData, …} | null, activeVersion, versions, usage}.",
      "example": {
        "template_id": "account-welcome"
      },
      "http": {
        "method": "GET",
        "path": "/templates/{template_id}"
      }
    },
    {
      "name": "update_template_draft",
      "title": "Save a template draft",
      "group": "templates",
      "description": "Save the template's editable draft using optimistic concurrency: pass the current `revision` from get_template (409 means someone else saved first; re-read and retry). This is a full replacement of draft content: omitted fields are cleared, so send every field you want to keep. Use `{{variable}}` placeholders.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Save a template draft"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "template_id": {
            "type": "string",
            "description": "Template ID or key.",
            "minLength": 1,
            "maxLength": 128
          },
          "revision": {
            "type": "integer",
            "description": "Current draft revision from get_template.",
            "minimum": 1
          },
          "name": {
            "type": "string",
            "description": "Template name.",
            "maxLength": 120
          },
          "subject_template": {
            "type": "string",
            "description": "Subject with placeholders.",
            "maxLength": 998
          },
          "preheader_template": {
            "type": "string",
            "description": "Preview text.",
            "maxLength": 240
          },
          "html_template": {
            "type": "string",
            "description": "HTML body with placeholders."
          },
          "text_template": {
            "type": "string",
            "description": "Plain-text body with placeholders."
          },
          "from": {
            "type": "string",
            "description": "Default sender for sends of this template."
          },
          "reply_to": {
            "type": "string",
            "description": "Default Reply-To."
          },
          "variables": {
            "type": "array",
            "description": "Typed variable contract. Each item: {key (lowercase/underscores), label, type: text|number|url|boolean, required (default true), fallback, description}.",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "text",
                    "number",
                    "url",
                    "boolean"
                  ]
                },
                "required": {
                  "type": "boolean"
                },
                "fallback": {},
                "description": {
                  "type": "string"
                }
              },
              "required": [
                "key"
              ],
              "additionalProperties": false
            }
          },
          "sample_data": {
            "type": "object",
            "description": "Sample values used for previews and tests.",
            "additionalProperties": true
          }
        },
        "additionalProperties": false,
        "required": [
          "template_id",
          "revision"
        ]
      },
      "returns": "{template, draft: {revision: next}, validation: {valid, findings}}.",
      "example": {
        "template_id": "account-welcome",
        "revision": 3,
        "name": "Account welcome",
        "subject_template": "Welcome, {{first_name}}",
        "text_template": "Hi {{first_name}}",
        "variables": [
          {
            "key": "first_name",
            "type": "text",
            "required": true
          }
        ],
        "sample_data": {
          "first_name": "Asha"
        }
      },
      "http": {
        "method": "PUT",
        "path": "/templates/{template_id}/draft",
        "body": [
          "revision",
          "name",
          "subject_template:subjectTemplate",
          "preheader_template:preheaderTemplate",
          "html_template:htmlTemplate",
          "text_template:textTemplate",
          "from",
          "reply_to:replyTo",
          "variables",
          "sample_data:sampleData"
        ]
      }
    },
    {
      "name": "create_template_draft",
      "title": "Start a new draft from the published release",
      "group": "templates",
      "description": "Create a new editable draft copied from the current published release (409 if a draft already exists or nothing is published).",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Start a new draft from the published release"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "template_id": {
            "type": "string",
            "description": "Template ID or key.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "template_id"
        ]
      },
      "returns": "{draft}.",
      "example": {
        "template_id": "account-welcome"
      },
      "http": {
        "method": "POST",
        "path": "/templates/{template_id}/draft"
      }
    },
    {
      "name": "render_template",
      "title": "Render a template preview",
      "group": "templates",
      "description": "Render the exact server output (subject, html, text) for the draft, the published release, or a specific version with the given data. Does not send. Returns 422 with `findings` when data violates the variable contract.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Render a template preview"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "template_id": {
            "type": "string",
            "description": "Template ID or key.",
            "minLength": 1,
            "maxLength": 128
          },
          "version_id": {
            "type": "string",
            "description": "Optional version ID; defaults to the draft, then the published release."
          },
          "data": {
            "type": "object",
            "description": "Variable values; defaults to the version's sample data.",
            "additionalProperties": true
          }
        },
        "additionalProperties": false,
        "required": [
          "template_id"
        ]
      },
      "returns": "{subject, html, text, preheader, versionId, versionNumber, isDraft, findings}.",
      "example": {
        "template_id": "account-welcome",
        "data": {
          "first_name": "Asha"
        }
      },
      "http": {
        "method": "POST",
        "path": "/templates/{template_id}/render",
        "body": [
          "version_id:versionId",
          "data"
        ]
      }
    },
    {
      "name": "send_template_test",
      "title": "Send a template test email",
      "group": "templates",
      "description": "SENDS REAL EMAIL. Send a `[Test]`-prefixed snapshot of the draft (or a given version) to the given recipients. Counts against usage; trial workspaces can only send to the account email or a mailbox-simulator test address.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": true,
        "title": "Send a template test email"
      },
      "sends_email": true,
      "inputSchema": {
        "type": "object",
        "properties": {
          "template_id": {
            "type": "string",
            "description": "Template ID or key.",
            "minLength": 1,
            "maxLength": 128
          },
          "to": {
            "type": "array",
            "description": "Test recipients.",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 320
            },
            "minItems": 1,
            "maxItems": 100
          },
          "from": {
            "type": "string",
            "description": "Sender on a verified domain; defaults to the template's From."
          },
          "version_id": {
            "type": "string",
            "description": "Optional version ID."
          },
          "data": {
            "type": "object",
            "description": "Variable values; defaults to sample data.",
            "additionalProperties": true
          }
        },
        "additionalProperties": false,
        "required": [
          "template_id",
          "to"
        ]
      },
      "returns": "{id: `em_…`, providerMessageId, threadId, isTest: true}.",
      "example": {
        "template_id": "account-welcome",
        "to": [
          "owner@example.com"
        ]
      },
      "http": {
        "method": "POST",
        "path": "/templates/{template_id}/test",
        "body": [
          "to",
          "from",
          "version_id:versionId",
          "data"
        ]
      }
    },
    {
      "name": "publish_template",
      "title": "Publish a template release",
      "group": "templates",
      "description": "Publish the current draft as an immutable release that `send_email` with `template.key` will use. Fails with 422 findings on validation errors, or 409 if it would break the live variable contract of a template already used in production.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Publish a template release"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "template_id": {
            "type": "string",
            "description": "Template ID or key.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "template_id"
        ]
      },
      "returns": "{template, published}.",
      "example": {
        "template_id": "account-welcome"
      },
      "http": {
        "method": "POST",
        "path": "/templates/{template_id}/publish"
      }
    },
    {
      "name": "archive_template",
      "title": "Archive a template",
      "group": "templates",
      "description": "Stop new sends that use this template (history is kept; reversible with restore_template). Any integration sending this key will start failing with 404.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Archive a template"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "template_id": {
            "type": "string",
            "description": "Template ID or key.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "template_id"
        ]
      },
      "returns": "{template}.",
      "example": {
        "template_id": "account-welcome"
      },
      "http": {
        "method": "POST",
        "path": "/templates/{template_id}/archive"
      }
    },
    {
      "name": "restore_template",
      "title": "Restore an archived template",
      "group": "templates",
      "description": "Make an archived template active again.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Restore an archived template"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "template_id": {
            "type": "string",
            "description": "Template ID or key.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "template_id"
        ]
      },
      "returns": "{template}.",
      "example": {
        "template_id": "account-welcome"
      },
      "http": {
        "method": "POST",
        "path": "/templates/{template_id}/restore"
      }
    },
    {
      "name": "list_domains",
      "title": "List domains",
      "group": "domains",
      "description": "List sending domains with aggregate `setup_status` (verified | checking | pending), per-record DNS state, and inbound status. Can be slow: unverified domains are re-checked live. Paginated: the result includes `pagination` {offset, limit, returned, total?, has_more, next_offset}.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "List domains"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false
      },
      "returns": "{data: [domains with records], count, pagination}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/domains",
        "pagination": "client"
      }
    },
    {
      "name": "get_domain",
      "title": "Get domain setup details",
      "group": "domains",
      "description": "Retrieve one domain with the exact DNS records to publish (type, name, value), each record's live state from two public resolvers, `dns_issues` with fixes, and inbound status.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Get domain setup details"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "domain_id": {
            "type": "string",
            "description": "Domain ID (starts with `dom_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "domain_id"
        ]
      },
      "returns": "{id, name, status, setup_status, dns_propagating, records: [{type, name, value, verified, dns_state}], dns_issues: [{code, message, …}], inbound_domain, inbound_status}.",
      "example": {
        "domain_id": "dom_123"
      },
      "http": {
        "method": "GET",
        "path": "/domains/{domain_id}"
      }
    },
    {
      "name": "add_domain",
      "title": "Add a sending domain",
      "group": "domains",
      "description": "Register a domain you control for sending. Returns the DNS records (Easy DKIM CNAMEs) the owner must publish. Does not change DNS itself. Counts against the plan's domain limit.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": true,
        "title": "Add a sending domain"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Bare domain name, e.g. `example.com` or `mail.example.com`.",
            "minLength": 3,
            "maxLength": 253,
            "pattern": "^[a-z0-9.-]+\\.[a-z]{2,}$"
          },
          "default_from": {
            "type": "string",
            "description": "Optional default sender address on this domain."
          }
        },
        "additionalProperties": false,
        "required": [
          "name"
        ]
      },
      "returns": "{id: `dom_…`, name, status: pending, records: [...], ses: {configured}}.",
      "example": {
        "name": "example.com"
      },
      "http": {
        "method": "POST",
        "path": "/domains",
        "body": [
          "name",
          "default_from"
        ]
      }
    },
    {
      "name": "verify_domain",
      "title": "Verify a domain",
      "group": "domains",
      "description": "Run a live DNS and DKIM verification check now. Safe to repeat; poll every 30–60 s after DNS changes (propagation can take minutes to hours). Sending is allowed once status is `verified`.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Verify a domain"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "domain_id": {
            "type": "string",
            "description": "Domain ID (starts with `dom_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "domain_id"
        ]
      },
      "returns": "{domain, checks: {ses, dkim, dkim_status}, status: verified|pending}.",
      "example": {
        "domain_id": "dom_123"
      },
      "http": {
        "method": "POST",
        "path": "/domains/{domain_id}/verify"
      }
    },
    {
      "name": "delete_domain",
      "title": "Delete a domain",
      "group": "domains",
      "description": "DESTRUCTIVE: remove the domain from the workspace, including its inbound receiving route. Sends from it fail immediately afterwards. It does not delete DNS records at your DNS provider.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Delete a domain"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "domain_id": {
            "type": "string",
            "description": "Domain ID (starts with `dom_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "domain_id"
        ]
      },
      "returns": "{ok: true}.",
      "example": {
        "domain_id": "dom_123"
      },
      "http": {
        "method": "DELETE",
        "path": "/domains/{domain_id}"
      }
    },
    {
      "name": "get_dns_provider",
      "title": "Detect DNS provider and record hosts",
      "group": "domains",
      "description": "Detect the domain's authoritative DNS provider and return the relative host to type into that provider for each record, the recommended DMARC record, inbound MX guidance, and whether one-click setup (Domain Connect) is available.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Detect DNS provider and record hosts"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "domain_id": {
            "type": "string",
            "description": "Domain ID (starts with `dom_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "domain_id"
        ]
      },
      "returns": "{detectionStatus, detected, zone, nameservers, recordHosts: {recordId: host}, inbound, recommendations, authentication, providers: {domainConnect: {available, providerName}}}.",
      "example": {
        "domain_id": "dom_123"
      },
      "http": {
        "method": "GET",
        "path": "/dns/provider",
        "query": [
          "domain_id"
        ]
      }
    },
    {
      "name": "get_domain_connect_link",
      "title": "Get a one-click DNS setup link",
      "group": "domains",
      "description": "When get_dns_provider reports `providers.domainConnect.available`, create a signed consent URL. Give it to the human: they open it and approve the DNS change at their provider. Nothing changes until they approve. 409 if unsupported.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": true,
        "title": "Get a one-click DNS setup link"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "domain_id": {
            "type": "string",
            "description": "Domain ID (starts with `dom_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "domain_id"
        ]
      },
      "returns": "{url, providerName}.",
      "example": {
        "domain_id": "dom_123"
      },
      "http": {
        "method": "GET",
        "path": "/dns/domain-connect/connect",
        "query": [
          "domain_id"
        ]
      }
    },
    {
      "name": "setup_inbound",
      "title": "Enable inbound receiving for a domain",
      "group": "inbound",
      "description": "Provision inbound receiving for a verified domain. Uses the root domain when it has no conflicting MX, otherwise `inbound.<domain>`. Returns the MX record the owner must publish; it does not edit DNS.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Enable inbound receiving for a domain"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "domain_id": {
            "type": "string",
            "description": "Domain ID (starts with `dom_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "domain_id"
        ]
      },
      "returns": "{domain: receiving domain, status: dns_pending|ready, record: {type: MX, name, value}}.",
      "example": {
        "domain_id": "dom_123"
      },
      "http": {
        "method": "POST",
        "path": "/domains/{domain_id}/inbound/setup"
      }
    },
    {
      "name": "verify_inbound",
      "title": "Verify inbound MX",
      "group": "inbound",
      "description": "Re-check the inbound MX record. Status becomes `ready` when both public resolvers see it.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Verify inbound MX"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "domain_id": {
            "type": "string",
            "description": "Domain ID (starts with `dom_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "domain_id"
        ]
      },
      "returns": "{domain, status: ready|dns_pending|propagating|checking, record}.",
      "example": {
        "domain_id": "dom_123"
      },
      "http": {
        "method": "POST",
        "path": "/domains/{domain_id}/inbound/verify"
      }
    },
    {
      "name": "list_inboxes",
      "title": "List inbound addresses",
      "group": "inbound",
      "description": "List receiving addresses, optionally for one domain. Paginated: the result includes `pagination` {offset, limit, returned, total?, has_more, next_offset}.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "List inbound addresses"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "domain_id": {
            "type": "string",
            "description": "Optional domain ID filter."
          },
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false
      },
      "returns": "{data: [{id, address, name, status, domainId}], count, pagination}.",
      "example": {
        "domain_id": "dom_123"
      },
      "http": {
        "method": "GET",
        "path": "/inboxes",
        "query": [
          "domain_id"
        ],
        "pagination": "client"
      }
    },
    {
      "name": "get_inbox",
      "title": "Get an inbox",
      "group": "inbound",
      "description": "Retrieve one inbound address.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Get an inbox"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "inbox_id": {
            "type": "string",
            "description": "Inbox ID (starts with `inb_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "inbox_id"
        ]
      },
      "returns": "Inbox object.",
      "example": {
        "inbox_id": "inb_123"
      },
      "http": {
        "method": "GET",
        "path": "/inboxes/{inbox_id}"
      }
    },
    {
      "name": "create_inbox",
      "title": "Create an inbound address",
      "group": "inbound",
      "description": "Create an address such as `support@<receiving domain>` on a domain whose inbound status is `ready` (run setup_inbound and verify_inbound first). Received mail appears in list_emails with direction `in`.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Create an inbound address"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "domain_id": {
            "type": "string",
            "description": "Domain ID (starts with `dom_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          },
          "local_part": {
            "type": "string",
            "description": "Part before @, e.g. `support`.",
            "minLength": 1,
            "maxLength": 64
          },
          "name": {
            "type": "string",
            "description": "Optional display name."
          }
        },
        "additionalProperties": false,
        "required": [
          "domain_id",
          "local_part"
        ]
      },
      "returns": "{id: `inb_…`, address, name, status: active}.",
      "example": {
        "domain_id": "dom_123",
        "local_part": "support",
        "name": "Support"
      },
      "http": {
        "method": "POST",
        "path": "/inboxes",
        "body": [
          "domain_id",
          "local_part",
          "name"
        ]
      }
    },
    {
      "name": "update_inbox",
      "title": "Rename, enable, or disable an inbox",
      "group": "inbound",
      "description": "Rename an inbox or set its status to `active` / `disabled`.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Rename, enable, or disable an inbox"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "inbox_id": {
            "type": "string",
            "description": "Inbox ID (starts with `inb_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          },
          "name": {
            "type": "string",
            "description": "New display name."
          },
          "status": {
            "type": "string",
            "description": "New status.",
            "enum": [
              "active",
              "disabled"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "inbox_id"
        ]
      },
      "returns": "Updated inbox.",
      "example": {
        "inbox_id": "inb_123",
        "status": "disabled"
      },
      "http": {
        "method": "PATCH",
        "path": "/inboxes/{inbox_id}",
        "body": [
          "name",
          "status"
        ]
      }
    },
    {
      "name": "set_inbox_forwarding",
      "title": "Forward an inbox to another address",
      "group": "inbound",
      "description": "SENDS REAL EMAIL when forwarding to someone other than the account owner: sets where an inbox's received mail is forwarded. The owner's own address activates immediately; any other address gets a confirmation email and forwarding stays `pending` until someone there confirms. Pass `forward_to: null` to turn forwarding off. Forwarded copies come from the inbox address with the original sender as Reply-To.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Forward an inbox to another address"
      },
      "sends_email": true,
      "inputSchema": {
        "type": "object",
        "properties": {
          "inbox_id": {
            "type": "string",
            "description": "Inbox ID (starts with `inb_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          },
          "forward_to": {
            "type": [
              "string",
              "null"
            ],
            "description": "Forwarding target email address, or null to turn forwarding off.",
            "maxLength": 254
          }
        },
        "additionalProperties": false,
        "required": [
          "inbox_id",
          "forward_to"
        ]
      },
      "returns": "Inbox with `forwardTo` and `forwardStatus` (`off`, `pending`, or `active`).",
      "example": {
        "inbox_id": "inb_123",
        "forward_to": "team@example.net"
      },
      "http": {
        "method": "PUT",
        "path": "/inboxes/{inbox_id}/forwarding",
        "body": [
          "forward_to"
        ]
      }
    },
    {
      "name": "delete_inbox",
      "title": "Delete an inbox",
      "group": "inbound",
      "description": "DESTRUCTIVE: delete an inbound address. Mail already received is retained; new mail to the address is no longer filed to it.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Delete an inbox"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "inbox_id": {
            "type": "string",
            "description": "Inbox ID (starts with `inb_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "inbox_id"
        ]
      },
      "returns": "{ok: true}.",
      "example": {
        "inbox_id": "inb_123"
      },
      "http": {
        "method": "DELETE",
        "path": "/inboxes/{inbox_id}"
      }
    },
    {
      "name": "deliverability_stats",
      "title": "Get 30-day delivery stats",
      "group": "deliverability",
      "description": "Workspace-wide 30-day totals: sent, delivery, bounce, complaint, reject, open, click, and deliveryRate (%).",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Get 30-day delivery stats"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "returns": "{window: 30d, sent, delivery, bounce, complaint, reject, open, click, deliveryRate}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/deliverability/stats"
      }
    },
    {
      "name": "deliverability_account",
      "title": "Get account delivery rates",
      "group": "deliverability",
      "description": "Daily ladder, today's usage, 7-day hard-bounce and complaint rates against the promote, hold, and pause thresholds, and a per-day trend. Diagnostic text is plain text.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Get account delivery rates"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "days": {
            "type": "integer",
            "enum": [
              7,
              30,
              90
            ]
          }
        },
        "additionalProperties": false
      },
      "returns": "{days, trend, rolling7d, thresholds, ladder}.",
      "example": {
        "days": 30
      },
      "http": {
        "method": "GET",
        "path": "/deliverability/account"
      }
    },
    {
      "name": "deliverability_domains",
      "title": "Get domain delivery rates",
      "group": "deliverability",
      "description": "Per sending domain: sent, delivered, hard and soft bounces, complaints, failures, rates, and an active Gmail cap or 4.7.28 backoff when one applies.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Get domain delivery rates"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "days": {
            "type": "integer"
          },
          "domain": {
            "type": "string"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "additionalProperties": false
      },
      "returns": "{days, data, count, limit, offset}.",
      "example": {
        "days": 30
      },
      "http": {
        "method": "GET",
        "path": "/deliverability/domains"
      }
    },
    {
      "name": "deliverability_senders",
      "title": "Get sender delivery rates",
      "group": "deliverability",
      "description": "Per From address: sent, delivered, hard and soft bounces, complaints, failures, and rates.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Get sender delivery rates"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "days": {
            "type": "integer"
          },
          "domain": {
            "type": "string"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "additionalProperties": false
      },
      "returns": "{days, data, count, limit, offset}.",
      "example": {
        "days": 30
      },
      "http": {
        "method": "GET",
        "path": "/deliverability/senders"
      }
    },
    {
      "name": "email_delivery",
      "title": "Get an email delivery timeline",
      "group": "emails",
      "description": "Queued, sent, delivered, delayed, bounced, complained, and failed events for one email, with bounce type and the SMTP diagnostic. Reasons are plain text.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Get an email delivery timeline"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "email_id": {
            "type": "string"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "required": [
          "email_id"
        ],
        "additionalProperties": false
      },
      "returns": "{emailId, status, timeline, count, limit, offset}.",
      "example": {
        "email_id": "em_123"
      },
      "http": {
        "method": "GET",
        "path": "/emails/{email_id}/delivery"
      }
    },
    {
      "name": "thread_delivery",
      "title": "Get a thread delivery summary",
      "group": "emails",
      "description": "Counts of delivered, bounced, complained, and failed outbound messages in one conversation, plus each message's failure reason.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Get a thread delivery summary"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "thread_id": {
            "type": "string"
          }
        },
        "required": [
          "thread_id"
        ],
        "additionalProperties": false
      },
      "returns": "{threadId, delivered, bounced, complained, failed, messages}.",
      "example": {
        "thread_id": "thr_123"
      },
      "http": {
        "method": "GET",
        "path": "/threads/{thread_id}/delivery"
      }
    },
    {
      "name": "list_sender_reputation",
      "title": "List sender reputation",
      "group": "deliverability",
      "description": "Reputation state per exact From address: `active`, `throttled` (lower daily limit), or `paused` (sends return 423), with the reason and daily limit. Check this when sends fail with 423 or 429. Paginated: the result includes `pagination` {offset, limit, returned, total?, has_more, next_offset}.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "List sender reputation"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false
      },
      "returns": "{data: [{sender, status, dailyLimit, reason, cleanSince, warnedAt, pausedAt, evaluatedAt}], count, pagination}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/deliverability/reputation",
        "pagination": "client"
      }
    },
    {
      "name": "list_suppressions",
      "title": "List suppressions",
      "group": "deliverability",
      "description": "Workspace suppression list: recipients blocked after a permanent bounce or a spam complaint. Sends to them fail with 422. Paginated: the result includes `pagination` {offset, limit, returned, total?, has_more, next_offset}.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "List suppressions"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false
      },
      "returns": "{data: [{email, reason, detail, created_at}], count, pagination}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/suppressions",
        "query": [
          "limit",
          "offset"
        ],
        "pagination": "server"
      }
    },
    {
      "name": "remove_suppression",
      "title": "Remove a bounce suppression",
      "group": "deliverability",
      "description": "DESTRUCTIVE (weakens a safety block): remove a bounce suppression so the address can be mailed again. Only do this when the human confirms the address is now valid. Complaint suppressions cannot be removed (409).",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Remove a bounce suppression"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Suppressed recipient address.",
            "minLength": 3,
            "maxLength": 320
          }
        },
        "additionalProperties": false,
        "required": [
          "email"
        ]
      },
      "returns": "{ok: true}.",
      "example": {
        "email": "fixed-mailbox@example.net"
      },
      "http": {
        "method": "DELETE",
        "path": "/suppressions/{email}"
      }
    },
    {
      "name": "list_blocked_recipients",
      "title": "List blocked recipients",
      "group": "deliverability",
      "description": "Every recipient SendHQ will refuse: bounces, complaints, and domain-scoped marketing unsubscribes, with a summary by kind. Reads up to the newest 500. Paginated: the result includes `pagination` {offset, limit, returned, total?, has_more, next_offset}.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "List blocked recipients"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false
      },
      "returns": "{data: [{email, domain, kind: bounce|complaint|unsubscribe, reason, detail, source, status, created_at}], count, summary: {total, bounce, complaint, unsubscribe}, pagination}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/blocked-recipients",
        "fixed_query": {
          "limit": "500"
        },
        "pagination": "client"
      }
    },
    {
      "name": "get_account",
      "title": "Get account, usage, and billing",
      "group": "account",
      "description": "Account owner email, plan/access tier, current-period recipient deliveries used vs quota, domains used vs limit, attachment transfer, reputation summary, subscription state, published plans, and workspace counts. Use it to check remaining quota or who the trial can deliver to (the account email).",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Get account, usage, and billing"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "returns": "{user: {email, …}, usage: {domainsUsed, domainLimit, recipientDeliveries, emailQuotaMonth, attachmentBytes, attachmentByteLimit, periodKey}, access: {tier, planCode}, reputation, infrastructure, billing: {status, subscriptions, …}, plans, workspace: {mailer, stats}}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/account"
      }
    },
    {
      "name": "get_account_diagnostics",
      "title": "Diagnose sending and receiving",
      "group": "account",
      "description": "One read that explains what is wrong with sending or receiving in this workspace: an issues list (unverified domains and missing DKIM records, inbound MX not ready, paused or throttled senders, quota or daily limit reached, trial restrictions, high bounce or complaint rates, failing webhooks), plan and usage against limits, each domain with its DKIM and inbound state, sending identities, 30-day deliverability and sender reputation, suppressions and unsubscribes, and the last 30 days of messages that were not sent (with reasons) plus bounce, complaint and reject events. Start here when a user asks why mail is not arriving. Never returns message bodies or secrets.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Diagnose sending and receiving"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "returns": "{generatedAt, windowDays, issues: [{severity, code, message}], plan: {tier, usage, sendingLimit}, domains: [{name, status, dkim: {required, verified, missing}, inbound}], sendingIdentities, inbound, deliverability: {sent, delivered, bounced, complained, rates, senders}, suppressions: {total, byReason, unsubscribes, recent}, failures: {notSent, recentNotSent, recentProviderEvents}, webhooks}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/account/diagnostics"
      }
    },
    {
      "name": "get_analytics",
      "title": "Get sending analytics",
      "group": "account",
      "description": "Dashboard analytics for the last 7, 30, or 90 days: sent/received/delivered/bounced/blocked/opened/clicked/complaint totals, a daily timeline, top sending domains, and top subjects.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Get sending analytics"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "days": {
            "type": "integer",
            "description": "Window in days: 7, 30 (default), or 90.",
            "enum": [
              7,
              30,
              90
            ]
          }
        },
        "additionalProperties": false
      },
      "returns": "{window, days, metrics, timeline: [{day, sent, received}], domains, topContent}.",
      "example": {
        "days": 30
      },
      "http": {
        "method": "GET",
        "path": "/analytics",
        "query": [
          "days"
        ]
      }
    },
    {
      "name": "list_api_keys",
      "title": "List API key metadata",
      "group": "account",
      "description": "List API key names, non-secret prefixes, and last-used times. Read-only: this MCP server cannot create, rotate, or revoke keys; a human does that in the dashboard. Paginated: the result includes `pagination` {offset, limit, returned, total?, has_more, next_offset}.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "List API key metadata"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false
      },
      "returns": "{data: [{id, name, prefix, lastUsedAt, createdAt}], count, pagination}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/keys",
        "pagination": "client"
      }
    },
    {
      "name": "get_service_health",
      "title": "Check SendHQ service health",
      "group": "account",
      "description": "Check that the SendHQ API is up and which mail provider is active. Does not need a valid API key.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Check SendHQ service health"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "returns": "{ok, service, mailer}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/health"
      },
      "handler": "health"
    },
    {
      "name": "list_contacts",
      "title": "List contacts",
      "group": "campaigns",
      "description": "Campaigns: Newest-first contacts with their status, consent evidence, tags, custom fields, engagement (bot-filtered, estimated opens and clicks), and the lists they are subscribed to. Filter by list, status (including `dormant`), email/name substring (`*` is an email wildcard, e.g. `*@example.com`), tag, source, signup date, or a saved segment. Paginated: the result includes `pagination` {offset, limit, returned, has_more, next_offset}.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "List contacts"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "list_id": {
            "type": "string",
            "description": "Only members of this list (`lst_…`)."
          },
          "status": {
            "type": "string",
            "description": "Only contacts with this status. `dormant`: stopped opening and did not answer list cleanup, so broadcasts skip them.",
            "enum": [
              "subscribed",
              "pending",
              "unsubscribed",
              "bounced",
              "complained",
              "dormant"
            ]
          },
          "query": {
            "type": "string",
            "description": "Email or name contains this text; `*` is a wildcard on the email.",
            "maxLength": 200
          },
          "tag": {
            "type": "string",
            "description": "Only contacts with this tag.",
            "maxLength": 60
          },
          "source": {
            "type": "string",
            "description": "How the contact was added.",
            "enum": [
              "form",
              "api",
              "import"
            ]
          },
          "after": {
            "type": "string",
            "description": "Signed up at or after this time. ISO 8601 date or date-time.",
            "maxLength": 40
          },
          "before": {
            "type": "string",
            "description": "Signed up before this time. ISO 8601 date or date-time.",
            "maxLength": 40
          },
          "segment_id": {
            "type": "string",
            "description": "Only contacts matching this saved segment (`seg_…`)."
          },
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false
      },
      "returns": "{data: [contacts with tags, engagement, dormant, country], count, total, pagination}.",
      "example": {
        "status": "subscribed"
      },
      "http": {
        "method": "GET",
        "path": "/contacts",
        "query": [
          "list_id",
          "status",
          "query",
          "tag",
          "source",
          "after",
          "before",
          "segment_id"
        ],
        "pagination": "server"
      }
    },
    {
      "name": "create_contact",
      "title": "Add a contact",
      "group": "campaigns",
      "description": "Campaigns: Add one contact to the workspace, optionally to lists and with tags. A subscribed contact (the default) needs `consent_basis`: how this person agreed to receive your email. Only add people who asked for your email. Use `status: unsubscribed` to record an opt-out. Addresses already suppressed or unsubscribed from the workspace are stored with that status. Fails with 409 if the email already exists.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Add a contact"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Email address.",
            "minLength": 3,
            "maxLength": 320
          },
          "name": {
            "type": "string",
            "description": "Display name; the first word is `{{first_name}}`.",
            "maxLength": 200
          },
          "fields": {
            "type": "object",
            "description": "Custom fields (string, number, or boolean values), e.g. {\"plan\": \"pro\"}. Usable in broadcasts as `{{fields.plan}}` or `{{plan}}`. On update, a null value removes the field.",
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            }
          },
          "tags": {
            "type": "array",
            "description": "Tags to attach, e.g. [\"VIP\"]. Up to 50.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            },
            "maxItems": 50
          },
          "list_ids": {
            "type": "array",
            "description": "Lists to add the contact to (`lst_…`).",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "maxItems": 100
          },
          "status": {
            "type": "string",
            "description": "`subscribed` (default, requires consent_basis) or `unsubscribed`.",
            "enum": [
              "subscribed",
              "unsubscribed"
            ]
          },
          "consent_basis": {
            "type": "string",
            "description": "How these people agreed to receive your email, recorded as consent evidence, e.g. `Signed up on acme.com/newsletter (double opt-in), exported from Mailchimp`. 10-500 characters.",
            "minLength": 10,
            "maxLength": 500
          }
        },
        "additionalProperties": false,
        "required": [
          "email"
        ]
      },
      "returns": "The contact.",
      "example": {
        "email": "ada@example.net",
        "name": "Ada Lovelace",
        "consent_basis": "Ticked the newsletter box at checkout on acme.com"
      },
      "http": {
        "method": "POST",
        "path": "/contacts",
        "body": [
          "email",
          "name",
          "fields",
          "tags",
          "list_ids",
          "status",
          "consent_basis"
        ]
      }
    },
    {
      "name": "get_contact",
      "title": "Get a contact",
      "group": "campaigns",
      "description": "Campaigns: One contact by ID or email: status, consent evidence (source, basis, opt-in and confirmation times), custom fields, and subscribed lists.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Get a contact"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "contact_id": {
            "type": "string",
            "description": "Contact ID (starts with `ct_`) or the contact's email address.",
            "minLength": 1,
            "maxLength": 320
          }
        },
        "additionalProperties": false,
        "required": [
          "contact_id"
        ]
      },
      "returns": "The contact.",
      "example": {
        "contact_id": "ct_123"
      },
      "http": {
        "method": "GET",
        "path": "/contacts/{contact_id}"
      }
    },
    {
      "name": "update_contact",
      "title": "Update, tag, or unsubscribe a contact",
      "group": "campaigns",
      "description": "Campaigns: Change a contact's name, merge custom fields (null removes one), change tags (`tags` replaces the whole set; `add_tags` and `remove_tags` change it), or set `status` to `unsubscribed`. A contact can never be resubscribed through the API; only the recipient can, by confirming a signup form.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Update, tag, or unsubscribe a contact"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "contact_id": {
            "type": "string",
            "description": "Contact ID (starts with `ct_`) or the contact's email address.",
            "minLength": 1,
            "maxLength": 320
          },
          "name": {
            "type": "string",
            "description": "New display name.",
            "maxLength": 200
          },
          "fields": {
            "type": "object",
            "description": "Custom fields (string, number, or boolean values), e.g. {\"plan\": \"pro\"}. Usable in broadcasts as `{{fields.plan}}` or `{{plan}}`. On update, a null value removes the field.",
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            }
          },
          "tags": {
            "type": "array",
            "description": "Replace all of the contact's tags with these.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            },
            "maxItems": 50
          },
          "add_tags": {
            "type": "array",
            "description": "Tags to add.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            },
            "maxItems": 50
          },
          "remove_tags": {
            "type": "array",
            "description": "Tags to remove.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            },
            "maxItems": 50
          },
          "status": {
            "type": "string",
            "description": "Only `unsubscribed` is accepted.",
            "enum": [
              "unsubscribed"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "contact_id"
        ]
      },
      "returns": "The updated contact.",
      "example": {
        "contact_id": "ct_123",
        "fields": {
          "plan": "team"
        }
      },
      "http": {
        "method": "PATCH",
        "path": "/contacts/{contact_id}",
        "body": [
          "name",
          "fields",
          "tags",
          "add_tags",
          "remove_tags",
          "status"
        ]
      }
    },
    {
      "name": "delete_contact",
      "title": "Delete a contact",
      "group": "campaigns",
      "description": "DESTRUCTIVE: permanently delete a contact and its list memberships. Suppressions and recorded unsubscribes are kept, so the address still cannot be mailed if it is added again. Part of Campaigns.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Delete a contact"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "contact_id": {
            "type": "string",
            "description": "Contact ID (starts with `ct_`) or the contact's email address.",
            "minLength": 1,
            "maxLength": 320
          }
        },
        "additionalProperties": false,
        "required": [
          "contact_id"
        ]
      },
      "returns": "{ok: true}.",
      "example": {
        "contact_id": "ct_123"
      },
      "http": {
        "method": "DELETE",
        "path": "/contacts/{contact_id}"
      }
    },
    {
      "name": "import_contacts",
      "title": "Import contacts from CSV",
      "group": "campaigns",
      "description": "Campaigns: Import up to 5,000 CSV rows (5 MB) per call, optionally into a list. The header row needs an `email` column; `name` (or `first_name`/`last_name`), `status`, and `tags` (separated by `;` or `|`) are recognized and other columns become custom fields. `consent_basis` is required and recorded on every new contact. `tags` are added to every accepted row. Rows whose status says unsubscribed import as unsubscribed; existing contacts keep their status. Returns counts of accepted, created, existing, skipped (duplicates), and invalid rows with line numbers.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Import contacts from CSV"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "csv": {
            "type": "string",
            "description": "The CSV file content, header row first.",
            "minLength": 1,
            "maxLength": 5242880
          },
          "list_id": {
            "type": "string",
            "description": "Add every accepted row to this list (`lst_…`)."
          },
          "consent_basis": {
            "type": "string",
            "description": "How these people agreed to receive your email, recorded as consent evidence, e.g. `Signed up on acme.com/newsletter (double opt-in), exported from Mailchimp`. 10-500 characters.",
            "minLength": 10,
            "maxLength": 500
          },
          "tags": {
            "type": "array",
            "description": "Tags to add to every accepted row, e.g. [\"imported-2026-11\"].",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            },
            "maxItems": 50
          },
          "update_existing": {
            "type": "boolean",
            "description": "Merge names and fields into contacts that already exist. Their status never changes."
          }
        },
        "additionalProperties": false,
        "required": [
          "csv",
          "consent_basis"
        ]
      },
      "returns": "{id, accepted, created, existing, skipped, invalid, errors: [{line, reason}], tags}.",
      "example": {
        "csv": "email,name\nada@example.net,Ada Lovelace\n",
        "consent_basis": "Newsletter signups exported from Mailchimp (double opt-in)"
      },
      "http": {
        "method": "POST",
        "path": "/contact-imports",
        "body": [
          "csv",
          "list_id",
          "consent_basis",
          "tags",
          "update_existing"
        ]
      }
    },
    {
      "name": "list_contact_imports",
      "title": "List contact imports",
      "group": "campaigns",
      "description": "Campaigns: Recent CSV imports with their consent basis and row counts.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "List contact imports"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false
      },
      "returns": "{data: [imports], count, pagination}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/contact-imports",
        "pagination": "client"
      }
    },
    {
      "name": "bulk_update_contacts",
      "title": "Bulk update contacts",
      "group": "campaigns",
      "description": "DESTRUCTIVE when `action` is `delete` (permanent) or `unsubscribe` (cannot be undone through the API). Apply one action to up to 10,000 contacts: the IDs in `contact_ids`, or everyone matching `filter` (the list_contacts filters). Actions: `tag` / `untag` (with `tags`), `add_to_list` / `remove_from_list` (with `list_id`), `unsubscribe`, `delete`. Adding to a list mirrors each contact's status, so nobody is resubscribed. `delete` needs `confirm_count` equal to the number of contacts it would delete: call once without it to get that `count` (409), confirm with the user, then repeat with it. Part of Campaigns.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Bulk update contacts"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "description": "What to do.",
            "enum": [
              "tag",
              "untag",
              "add_to_list",
              "remove_from_list",
              "unsubscribe",
              "delete"
            ]
          },
          "contact_ids": {
            "type": "array",
            "description": "Contact IDs (`ct_…`). Use this or `filter`.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "maxItems": 10000
          },
          "filter": {
            "type": "object",
            "description": "Everyone matching these list_contacts filters. Use this or `contact_ids`.",
            "properties": {
              "list_id": {
                "type": "string",
                "description": "Members of this list."
              },
              "status": {
                "type": "string",
                "description": "Only contacts with this status. `dormant`: stopped opening and did not answer list cleanup, so broadcasts skip them.",
                "enum": [
                  "subscribed",
                  "pending",
                  "unsubscribed",
                  "bounced",
                  "complained",
                  "dormant"
                ]
              },
              "query": {
                "type": "string",
                "description": "Email or name contains; `*` is an email wildcard.",
                "maxLength": 200
              },
              "tag": {
                "type": "string",
                "description": "Has this tag.",
                "maxLength": 60
              },
              "source": {
                "type": "string",
                "description": "How the contact was added.",
                "enum": [
                  "form",
                  "api",
                  "import"
                ]
              },
              "after": {
                "type": "string",
                "description": "Signed up at or after. ISO 8601 date or date-time.",
                "maxLength": 40
              },
              "before": {
                "type": "string",
                "description": "Signed up before. ISO 8601 date or date-time.",
                "maxLength": 40
              },
              "segment_id": {
                "type": "string",
                "description": "Matches this segment."
              }
            },
            "additionalProperties": false
          },
          "tags": {
            "type": "array",
            "description": "For `tag` and `untag`.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            },
            "maxItems": 50
          },
          "list_id": {
            "type": "string",
            "description": "For `add_to_list` and `remove_from_list` (`lst_…`)."
          },
          "confirm_count": {
            "type": "integer",
            "description": "For `delete`: the number of contacts that will be deleted, from the 409 response.",
            "minimum": 0
          }
        },
        "required": [
          "action"
        ],
        "additionalProperties": false
      },
      "returns": "{ok, action, count}; for an unconfirmed delete, a 409 error whose message gives the count.",
      "example": {
        "action": "tag",
        "tags": [
          "october"
        ],
        "filter": {
          "list_id": "lst_123",
          "status": "subscribed"
        }
      },
      "http": {
        "method": "POST",
        "path": "/contacts/bulk",
        "body": [
          "action",
          "contact_ids",
          "filter",
          "tags",
          "list_id",
          "confirm_count"
        ]
      }
    },
    {
      "name": "list_tags",
      "title": "List contact tags",
      "group": "campaigns",
      "description": "Campaigns: The workspace's contact tags, most used first, with how many contacts carry each (up to 500). Paginated.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "List contact tags"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false
      },
      "returns": "{data: [{tag, count}], count, pagination}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/tags",
        "pagination": "client"
      }
    },
    {
      "name": "list_contact_fields",
      "title": "List custom contact fields",
      "group": "campaigns",
      "description": "Campaigns: Defined custom contact fields with label and type (`text`, `number`, `date`). Defined fields are known to check_broadcast's merge-tag check and typed in segment conditions. Contacts may also carry undefined keys. Paginated.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "List custom contact fields"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false
      },
      "returns": "{data: [{key, label, type, createdAt}], count, types, pagination}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/contact-fields",
        "pagination": "client"
      }
    },
    {
      "name": "set_contact_field",
      "title": "Define a custom contact field",
      "group": "campaigns",
      "description": "Campaigns: Create or change a custom field definition (label and type). Values live on each contact's `fields`. Built-in merge tags (email, name, first_name, last_name, fields, unsubscribe_url) cannot be used as keys. A workspace may define 50 fields.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Define a custom contact field"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "field_key": {
            "type": "string",
            "description": "Field key: a lowercase letter, then up to 39 of a-z, 0-9, and `_` (e.g. `plan`). Used in content as `{{fields.plan}}`.",
            "minLength": 1,
            "maxLength": 40,
            "pattern": "^[a-z][a-z0-9_]{0,39}$"
          },
          "label": {
            "type": "string",
            "description": "Label shown in the dashboard. Defaults to the key.",
            "maxLength": 80
          },
          "type": {
            "type": "string",
            "description": "`text` (default), `number`, or `date`.",
            "enum": [
              "text",
              "number",
              "date"
            ]
          }
        },
        "required": [
          "field_key"
        ],
        "additionalProperties": false
      },
      "returns": "{key, label, type, createdAt}.",
      "example": {
        "field_key": "plan",
        "label": "Plan",
        "type": "text"
      },
      "http": {
        "method": "PUT",
        "path": "/contact-fields/{field_key}",
        "body": [
          "label",
          "type"
        ]
      }
    },
    {
      "name": "delete_contact_field",
      "title": "Delete a custom field definition",
      "group": "campaigns",
      "description": "DESTRUCTIVE: delete a custom field definition. Values already stored on contacts are kept. Fails with 404 when the field is not defined. Part of Campaigns.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Delete a custom field definition"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "field_key": {
            "type": "string",
            "description": "Field key: a lowercase letter, then up to 39 of a-z, 0-9, and `_` (e.g. `plan`). Used in content as `{{fields.plan}}`.",
            "minLength": 1,
            "maxLength": 40,
            "pattern": "^[a-z][a-z0-9_]{0,39}$"
          }
        },
        "required": [
          "field_key"
        ],
        "additionalProperties": false
      },
      "returns": "{ok: true}.",
      "example": {
        "field_key": "plan"
      },
      "http": {
        "method": "DELETE",
        "path": "/contact-fields/{field_key}"
      }
    },
    {
      "name": "list_segments",
      "title": "List segments",
      "group": "campaigns",
      "description": "Campaigns: Saved segments with `count` (subscribed, non-dormant contacts in the workspace that match now) and `fields`, the condition fields and operators each accepts. Paginated.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "List segments"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false
      },
      "returns": "{data: [{id, name, match, conditions, count}], count, fields, pagination}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/segments",
        "pagination": "client"
      }
    },
    {
      "name": "get_segment",
      "title": "Get a segment",
      "group": "campaigns",
      "description": "Campaigns: One segment with its conditions and live count.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Get a segment"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "segment_id": {
            "type": "string",
            "description": "Segment ID (starts with `seg_`), as returned by list_segments or create_segment.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "required": [
          "segment_id"
        ],
        "additionalProperties": false
      },
      "returns": "{id, name, match, conditions, count}.",
      "example": {
        "segment_id": "seg_123"
      },
      "http": {
        "method": "GET",
        "path": "/segments/{segment_id}"
      }
    },
    {
      "name": "preview_segment",
      "title": "Preview segment conditions",
      "group": "campaigns",
      "description": "Campaigns: Count and sample (up to 5) the subscribed, non-dormant contacts that match conditions without saving them. Read-only; use it to check conditions before create_segment.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Preview segment conditions"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "match": {
            "type": "string",
            "description": "`all` (default): every condition must match. `any`: at least one.",
            "enum": [
              "all",
              "any"
            ]
          },
          "conditions": {
            "type": "array",
            "description": "Up to 20 conditions. Opened and clicked use bot-filtered, estimated engagement.",
            "items": {
              "type": "object",
              "description": "One condition: {field, op, value}.",
              "properties": {
                "field": {
                  "type": "string",
                  "description": "tag, list, status, source, email, name, signed_up, opened, clicked, opens, sends_without_open, country, or a custom field as `fields.<key>` (or `field` together with `key`).",
                  "minLength": 1,
                  "maxLength": 48
                },
                "key": {
                  "type": "string",
                  "description": "Custom field key when `field` is `field`.",
                  "maxLength": 40
                },
                "op": {
                  "type": "string",
                  "description": "tag: has, not_has. list: in, not_in (a list ID). status: is, is_not (subscribed, pending, unsubscribed, bounced, complained, dormant). source: is, is_not (form, api, import). email: contains, not_contains, ends_with. name: is_set, not_set. signed_up: before, after (YYYY-MM-DD), in_last_days, not_in_last_days. opened / clicked: in_last_days, not_in_last_days, ever, never. opens / sends_without_open: gte, lte. country: is, is_not (two-letter code). Custom fields: equals, not_equals, contains, gt, lt, before, after, is_set, not_set.",
                  "enum": [
                    "has",
                    "not_has",
                    "in",
                    "not_in",
                    "is",
                    "is_not",
                    "contains",
                    "not_contains",
                    "ends_with",
                    "is_set",
                    "not_set",
                    "before",
                    "after",
                    "in_last_days",
                    "not_in_last_days",
                    "ever",
                    "never",
                    "gte",
                    "lte",
                    "equals",
                    "not_equals",
                    "gt",
                    "lt"
                  ]
                },
                "value": {
                  "type": [
                    "string",
                    "number"
                  ],
                  "description": "Required except for is_set, not_set, ever, and never. A number of days for in_last_days / not_in_last_days, a number for gte, lte, gt, lt, a date (YYYY-MM-DD) for before / after."
                }
              },
              "required": [
                "field",
                "op"
              ],
              "additionalProperties": false
            },
            "maxItems": 20
          }
        },
        "additionalProperties": false
      },
      "returns": "{count, sample: [contacts]}.",
      "example": {
        "match": "all",
        "conditions": [
          {
            "field": "tag",
            "op": "has",
            "value": "VIP"
          },
          {
            "field": "opened",
            "op": "in_last_days",
            "value": 90
          }
        ]
      },
      "http": {
        "method": "POST",
        "path": "/segments/preview",
        "body": [
          "match",
          "conditions"
        ]
      }
    },
    {
      "name": "create_segment",
      "title": "Create a segment",
      "group": "campaigns",
      "description": "Campaigns: Save a segment: up to 20 conditions joined by `match`. Use it as a broadcast's `audience.segment_id`, as list_contacts `segment_id`, or in bulk_update_contacts filters. A workspace may have 200 segments.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Create a segment"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Segment name.",
            "minLength": 1,
            "maxLength": 120
          },
          "match": {
            "type": "string",
            "description": "`all` (default): every condition must match. `any`: at least one.",
            "enum": [
              "all",
              "any"
            ]
          },
          "conditions": {
            "type": "array",
            "description": "Up to 20 conditions. Opened and clicked use bot-filtered, estimated engagement.",
            "items": {
              "type": "object",
              "description": "One condition: {field, op, value}.",
              "properties": {
                "field": {
                  "type": "string",
                  "description": "tag, list, status, source, email, name, signed_up, opened, clicked, opens, sends_without_open, country, or a custom field as `fields.<key>` (or `field` together with `key`).",
                  "minLength": 1,
                  "maxLength": 48
                },
                "key": {
                  "type": "string",
                  "description": "Custom field key when `field` is `field`.",
                  "maxLength": 40
                },
                "op": {
                  "type": "string",
                  "description": "tag: has, not_has. list: in, not_in (a list ID). status: is, is_not (subscribed, pending, unsubscribed, bounced, complained, dormant). source: is, is_not (form, api, import). email: contains, not_contains, ends_with. name: is_set, not_set. signed_up: before, after (YYYY-MM-DD), in_last_days, not_in_last_days. opened / clicked: in_last_days, not_in_last_days, ever, never. opens / sends_without_open: gte, lte. country: is, is_not (two-letter code). Custom fields: equals, not_equals, contains, gt, lt, before, after, is_set, not_set.",
                  "enum": [
                    "has",
                    "not_has",
                    "in",
                    "not_in",
                    "is",
                    "is_not",
                    "contains",
                    "not_contains",
                    "ends_with",
                    "is_set",
                    "not_set",
                    "before",
                    "after",
                    "in_last_days",
                    "not_in_last_days",
                    "ever",
                    "never",
                    "gte",
                    "lte",
                    "equals",
                    "not_equals",
                    "gt",
                    "lt"
                  ]
                },
                "value": {
                  "type": [
                    "string",
                    "number"
                  ],
                  "description": "Required except for is_set, not_set, ever, and never. A number of days for in_last_days / not_in_last_days, a number for gte, lte, gt, lt, a date (YYYY-MM-DD) for before / after."
                }
              },
              "required": [
                "field",
                "op"
              ],
              "additionalProperties": false
            },
            "maxItems": 20
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "returns": "The segment with its count.",
      "example": {
        "name": "Engaged pro customers",
        "conditions": [
          {
            "field": "fields.plan",
            "op": "equals",
            "value": "pro"
          },
          {
            "field": "opened",
            "op": "in_last_days",
            "value": 90
          }
        ]
      },
      "http": {
        "method": "POST",
        "path": "/segments",
        "body": [
          "name",
          "match",
          "conditions"
        ]
      }
    },
    {
      "name": "update_segment",
      "title": "Update a segment",
      "group": "campaigns",
      "description": "Campaigns: Rename a segment or change `match` or `conditions` (which replaces the whole list). Broadcasts using it pick up the change when they start sending.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Update a segment"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "segment_id": {
            "type": "string",
            "description": "Segment ID (starts with `seg_`), as returned by list_segments or create_segment.",
            "minLength": 1,
            "maxLength": 128
          },
          "name": {
            "type": "string",
            "description": "Segment name.",
            "minLength": 1,
            "maxLength": 120
          },
          "match": {
            "type": "string",
            "description": "`all` (default): every condition must match. `any`: at least one.",
            "enum": [
              "all",
              "any"
            ]
          },
          "conditions": {
            "type": "array",
            "description": "Up to 20 conditions. Opened and clicked use bot-filtered, estimated engagement.",
            "items": {
              "type": "object",
              "description": "One condition: {field, op, value}.",
              "properties": {
                "field": {
                  "type": "string",
                  "description": "tag, list, status, source, email, name, signed_up, opened, clicked, opens, sends_without_open, country, or a custom field as `fields.<key>` (or `field` together with `key`).",
                  "minLength": 1,
                  "maxLength": 48
                },
                "key": {
                  "type": "string",
                  "description": "Custom field key when `field` is `field`.",
                  "maxLength": 40
                },
                "op": {
                  "type": "string",
                  "description": "tag: has, not_has. list: in, not_in (a list ID). status: is, is_not (subscribed, pending, unsubscribed, bounced, complained, dormant). source: is, is_not (form, api, import). email: contains, not_contains, ends_with. name: is_set, not_set. signed_up: before, after (YYYY-MM-DD), in_last_days, not_in_last_days. opened / clicked: in_last_days, not_in_last_days, ever, never. opens / sends_without_open: gte, lte. country: is, is_not (two-letter code). Custom fields: equals, not_equals, contains, gt, lt, before, after, is_set, not_set.",
                  "enum": [
                    "has",
                    "not_has",
                    "in",
                    "not_in",
                    "is",
                    "is_not",
                    "contains",
                    "not_contains",
                    "ends_with",
                    "is_set",
                    "not_set",
                    "before",
                    "after",
                    "in_last_days",
                    "not_in_last_days",
                    "ever",
                    "never",
                    "gte",
                    "lte",
                    "equals",
                    "not_equals",
                    "gt",
                    "lt"
                  ]
                },
                "value": {
                  "type": [
                    "string",
                    "number"
                  ],
                  "description": "Required except for is_set, not_set, ever, and never. A number of days for in_last_days / not_in_last_days, a number for gte, lte, gt, lt, a date (YYYY-MM-DD) for before / after."
                }
              },
              "required": [
                "field",
                "op"
              ],
              "additionalProperties": false
            },
            "maxItems": 20
          }
        },
        "required": [
          "segment_id"
        ],
        "additionalProperties": false
      },
      "returns": "The updated segment with its count.",
      "example": {
        "segment_id": "seg_123",
        "name": "Pro customers"
      },
      "http": {
        "method": "PATCH",
        "path": "/segments/{segment_id}",
        "body": [
          "name",
          "match",
          "conditions"
        ]
      }
    },
    {
      "name": "delete_segment",
      "title": "Delete a segment",
      "group": "campaigns",
      "description": "DESTRUCTIVE: delete a saved segment. Contacts are not affected. Fails with 409 while a sending or scheduled broadcast uses it. Part of Campaigns.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Delete a segment"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "segment_id": {
            "type": "string",
            "description": "Segment ID (starts with `seg_`), as returned by list_segments or create_segment.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "required": [
          "segment_id"
        ],
        "additionalProperties": false
      },
      "returns": "{ok: true}.",
      "example": {
        "segment_id": "seg_123"
      },
      "http": {
        "method": "DELETE",
        "path": "/segments/{segment_id}"
      }
    },
    {
      "name": "list_lists",
      "title": "List contact lists",
      "group": "campaigns",
      "description": "Campaigns: Contact lists with subscribed, pending, and unsubscribed counts and their hosted signup form settings.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "List contact lists"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false
      },
      "returns": "{data: [lists], count, pagination}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/lists",
        "pagination": "client"
      }
    },
    {
      "name": "create_list",
      "title": "Create a list",
      "group": "campaigns",
      "description": "Campaigns: Create a contact list. Set `form_enabled` to publish a hosted double opt-in signup form (its URL is in `form.url`); `form_from` is the sender, on a verified domain, of the confirmation email, and `redirect_url` is an optional https page shown after confirming. `welcome` sends one welcome email when someone confirms. `site` publishes a public newsletter site at https://sendhq.cc/n/<slug> with the signup form, sent issues, and RSS.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Create a list"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "List name, shown on the signup form.",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "description": "Short description shown on the signup form.",
            "maxLength": 500
          },
          "form_enabled": {
            "type": "boolean",
            "description": "Publish the hosted signup form."
          },
          "form_from": {
            "type": "string",
            "description": "Sender of signup confirmation emails, e.g. `Acme <news@example.com>`, on a verified domain.",
            "maxLength": 320
          },
          "redirect_url": {
            "type": "string",
            "description": "https page to open after a signup is confirmed.",
            "maxLength": 500
          },
          "welcome": {
            "type": "object",
            "description": "Welcome email sent once, from `form_from`, when someone confirms a signup. Needs `subject` and `html` or `markdown` when enabled.",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "Send it."
              },
              "subject": {
                "type": "string",
                "description": "Subject; merge tags allowed.",
                "maxLength": 300
              },
              "html": {
                "type": "string",
                "description": "HTML body; merge tags allowed.",
                "maxLength": 500000
              },
              "markdown": {
                "type": "string",
                "description": "Markdown body instead of `html`, rendered with the workspace design.",
                "maxLength": 200000
              }
            },
            "additionalProperties": false
          },
          "site": {
            "type": "object",
            "description": "Public newsletter site at https://sendhq.cc/n/<slug>: a signup form, every issue sent with `web.enabled`, and an RSS feed at /n/<slug>/feed.xml. Needs the signup form on. A reserved or taken slug fails with 409.",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "Publish the site."
              },
              "slug": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Address after /n/ (3-48 characters, a-z, 0-9, -). Defaults to the list name.",
                "maxLength": 48
              },
              "title": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Site title. Defaults to the list name.",
                "maxLength": 120
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Short description under the title.",
                "maxLength": 300
              },
              "accent": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Accent color, e.g. `#0a7d4f`.",
                "pattern": "^#[0-9a-fA-F]{6}$"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false,
        "required": [
          "name"
        ]
      },
      "returns": "The list.",
      "example": {
        "name": "Product updates"
      },
      "http": {
        "method": "POST",
        "path": "/lists",
        "body": [
          "name",
          "description",
          "form_enabled",
          "form_from",
          "redirect_url",
          "welcome",
          "site"
        ]
      }
    },
    {
      "name": "get_list",
      "title": "Get a list",
      "group": "campaigns",
      "description": "Campaigns: One list with member counts and signup form settings.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Get a list"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "list_id": {
            "type": "string",
            "description": "List ID (starts with `lst_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "list_id"
        ]
      },
      "returns": "The list.",
      "example": {
        "list_id": "lst_123"
      },
      "http": {
        "method": "GET",
        "path": "/lists/{list_id}"
      }
    },
    {
      "name": "update_list",
      "title": "Update a list",
      "group": "campaigns",
      "description": "Campaigns: Rename a list, change its description, or change its hosted signup form, welcome email, or newsletter site. Omitted keys inside `welcome` and `site` keep their value.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Update a list"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "list_id": {
            "type": "string",
            "description": "List ID (starts with `lst_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          },
          "name": {
            "type": "string",
            "description": "New name.",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "description": "New description.",
            "maxLength": 500
          },
          "form_enabled": {
            "type": "boolean",
            "description": "Publish or unpublish the hosted signup form."
          },
          "form_from": {
            "type": "string",
            "description": "Sender of signup confirmation emails, on a verified domain.",
            "maxLength": 320
          },
          "redirect_url": {
            "type": "string",
            "description": "https page to open after a signup is confirmed.",
            "maxLength": 500
          },
          "welcome": {
            "type": "object",
            "description": "Welcome email sent once, from `form_from`, when someone confirms a signup. Needs `subject` and `html` or `markdown` when enabled.",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "Send it."
              },
              "subject": {
                "type": "string",
                "description": "Subject; merge tags allowed.",
                "maxLength": 300
              },
              "html": {
                "type": "string",
                "description": "HTML body; merge tags allowed.",
                "maxLength": 500000
              },
              "markdown": {
                "type": "string",
                "description": "Markdown body instead of `html`, rendered with the workspace design.",
                "maxLength": 200000
              }
            },
            "additionalProperties": false
          },
          "site": {
            "type": "object",
            "description": "Public newsletter site at https://sendhq.cc/n/<slug>: a signup form, every issue sent with `web.enabled`, and an RSS feed at /n/<slug>/feed.xml. Needs the signup form on. A reserved or taken slug fails with 409.",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "Publish the site."
              },
              "slug": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Address after /n/ (3-48 characters, a-z, 0-9, -). Defaults to the list name.",
                "maxLength": 48
              },
              "title": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Site title. Defaults to the list name.",
                "maxLength": 120
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Short description under the title.",
                "maxLength": 300
              },
              "accent": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Accent color, e.g. `#0a7d4f`.",
                "pattern": "^#[0-9a-fA-F]{6}$"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false,
        "required": [
          "list_id"
        ]
      },
      "returns": "The updated list.",
      "example": {
        "list_id": "lst_123",
        "form_enabled": false
      },
      "http": {
        "method": "PATCH",
        "path": "/lists/{list_id}",
        "body": [
          "name",
          "description",
          "form_enabled",
          "form_from",
          "redirect_url",
          "welcome",
          "site"
        ]
      }
    },
    {
      "name": "delete_list",
      "title": "Delete a list",
      "group": "campaigns",
      "description": "DESTRUCTIVE: delete a list and its memberships. The contacts themselves are kept. Fails with 409 while a broadcast to the list is sending. Part of Campaigns.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Delete a list"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "list_id": {
            "type": "string",
            "description": "List ID (starts with `lst_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "list_id"
        ]
      },
      "returns": "{ok: true}.",
      "example": {
        "list_id": "lst_123"
      },
      "http": {
        "method": "DELETE",
        "path": "/lists/{list_id}"
      }
    },
    {
      "name": "add_list_contacts",
      "title": "Add contacts to a list",
      "group": "campaigns",
      "description": "Campaigns: Add up to 500 existing contacts to a list by ID or email. Subscribed contacts join subscribed; others join in their current state. Unknown references come back in `notFound`.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Add contacts to a list"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "list_id": {
            "type": "string",
            "description": "List ID (starts with `lst_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          },
          "contact_ids": {
            "type": "array",
            "description": "Contact IDs (`ct_…`).",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "maxItems": 500
          },
          "emails": {
            "type": "array",
            "description": "Contact email addresses.",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 320
            },
            "maxItems": 500
          }
        },
        "additionalProperties": false,
        "required": [
          "list_id"
        ]
      },
      "returns": "{listId, added, notFound, list}.",
      "example": {
        "list_id": "lst_123",
        "emails": [
          "ada@example.net"
        ]
      },
      "http": {
        "method": "POST",
        "path": "/lists/{list_id}/contacts",
        "body": [
          "contact_ids",
          "emails"
        ]
      }
    },
    {
      "name": "remove_list_contact",
      "title": "Remove a contact from a list",
      "group": "campaigns",
      "description": "DESTRUCTIVE: remove one contact from a list. The contact and its status are kept. Part of Campaigns.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Remove a contact from a list"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "list_id": {
            "type": "string",
            "description": "List ID (starts with `lst_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          },
          "contact_id": {
            "type": "string",
            "description": "Contact ID (starts with `ct_`) or the contact's email address.",
            "minLength": 1,
            "maxLength": 320
          }
        },
        "additionalProperties": false,
        "required": [
          "list_id",
          "contact_id"
        ]
      },
      "returns": "{ok: true}.",
      "example": {
        "list_id": "lst_123",
        "contact_id": "ct_123"
      },
      "http": {
        "method": "DELETE",
        "path": "/lists/{list_id}/contacts/{contact_id}"
      }
    },
    {
      "name": "list_broadcasts",
      "title": "List broadcasts",
      "group": "campaigns",
      "description": "Campaigns: Newest-first broadcasts with their status. Paginated: the result includes `pagination`.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "List broadcasts"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Only broadcasts with this status.",
            "enum": [
              "draft",
              "sending",
              "sent",
              "cancelled",
              "failed"
            ]
          },
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false
      },
      "returns": "{data: [broadcasts], count, pagination}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/broadcasts",
        "query": [
          "status"
        ],
        "pagination": "server"
      }
    },
    {
      "name": "create_broadcast",
      "title": "Create a broadcast draft",
      "group": "campaigns",
      "description": "Campaigns: Create a draft broadcast to one list. Content is `html` and/or `text`, `markdown`, a block document in `content`, or a published hosted `template`. Raw content supports merge tags: `{{first_name}}`, `{{name}}`, `{{email}}`, `{{fields.plan}}`, with fallbacks like `{{first_name | there}}`. `audience` narrows it to a segment and/or a number of people (most engaged first with `order: engaged`); `tracking` turns open and click tracking off; `web` publishes it on the list's newsletter site once sent. Nothing is sent until send_broadcast or schedule_broadcast; run check_broadcast and send_broadcast_test first.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Create a broadcast draft"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Internal name. Defaults to the subject.",
            "maxLength": 200
          },
          "list_id": {
            "type": "string",
            "description": "The list to send to (`lst_…`)."
          },
          "from": {
            "type": "string",
            "description": "Sender on a verified domain, e.g. `Acme <news@example.com>`.",
            "maxLength": 320
          },
          "reply_to": {
            "type": "string",
            "description": "Reply-To address.",
            "maxLength": 320
          },
          "subject": {
            "type": "string",
            "description": "Subject line; merge tags allowed.",
            "maxLength": 998
          },
          "preview_text": {
            "type": "string",
            "description": "Inbox preview text shown after the subject.",
            "maxLength": 300
          },
          "html": {
            "type": "string",
            "description": "HTML body; merge tags allowed and escaped."
          },
          "text": {
            "type": "string",
            "description": "Plain-text body; merge tags allowed."
          },
          "template": {
            "type": "object",
            "description": "A published hosted template instead of subject/html/text. Template variables are filled from the contact's name, email, and fields.",
            "properties": {
              "id": {
                "type": "string"
              },
              "key": {
                "type": "string"
              },
              "version_id": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "markdown": {
            "type": "string",
            "description": "Markdown body instead of `html`: converted to a block document and rendered with the workspace design (get_newsletter_settings). Merge tags allowed. Not combinable with `html` or `content`.",
            "maxLength": 1000000
          },
          "content": {
            "type": [
              "object",
              "null"
            ],
            "description": "Block document ({\"type\": \"doc\", \"content\": [...]}, the dashboard editor's format: paragraph, heading, bulletList, orderedList, blockquote, image, button, callout, horizontalRule, codeBlock). Rendered with the workspace design unless `html` is also sent."
          },
          "editor": {
            "type": "string",
            "description": "Which editor the dashboard opens: `html` or `blocks`. Set automatically for `markdown` and `content`.",
            "enum": [
              "html",
              "blocks"
            ]
          },
          "audience": {
            "type": "object",
            "description": "Who gets it, within the list. Subscribed, non-dormant members only.",
            "properties": {
              "segment_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Only list members matching this segment (`seg_…`), or null for the whole list."
              },
              "order": {
                "type": "string",
                "description": "With a `limit`: `signup` (default) or `engaged` (most engaged first).",
                "enum": [
                  "signup",
                  "engaged"
                ]
              },
              "limit": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Send to at most this many people (send_broadcast_to_more sends to more later), or null for everyone.",
                "minimum": 1,
                "maximum": 10000000
              }
            },
            "additionalProperties": false
          },
          "tracking": {
            "type": "object",
            "description": "Open and click tracking, both on by default. Opens are estimates (bot-filtered pixel loads), never proof that someone read the email.",
            "properties": {
              "opens": {
                "type": "boolean",
                "description": "Add an open pixel."
              },
              "clicks": {
                "type": "boolean",
                "description": "Rewrite links to signed SendHQ redirects (the unsubscribe link never is)."
              }
            },
            "additionalProperties": false
          },
          "web": {
            "type": "object",
            "description": "Publish this issue on the list's newsletter site (see create_list `site`) once it is sent.",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "Publish it."
              },
              "slug": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Issue address; defaults to the subject.",
                "maxLength": 100
              },
              "pinned": {
                "type": "boolean",
                "description": "Keep it at the top of the site."
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "returns": "The draft broadcast.",
      "example": {
        "list_id": "lst_123",
        "from": "news@example.com",
        "subject": "October update",
        "markdown": "Hi {{first_name | there}}, here's what shipped.",
        "audience": {
          "order": "engaged",
          "limit": 1000
        }
      },
      "http": {
        "method": "POST",
        "path": "/broadcasts",
        "body": [
          "name",
          "list_id",
          "from",
          "reply_to",
          "subject",
          "preview_text",
          "html",
          "text",
          "template",
          "markdown",
          "content",
          "editor",
          "audience",
          "tracking",
          "web"
        ]
      }
    },
    {
      "name": "get_broadcast",
      "title": "Get a broadcast",
      "group": "campaigns",
      "description": "Campaigns: One broadcast with its content and, once sending, recipient totals (queued, sending, sent, held, skipped, failed). While a limit or reputation pause holds delivery, `lastError` explains why and `nextAttemptAt` says when it resumes.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Get a broadcast"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "broadcast_id": {
            "type": "string",
            "description": "Broadcast ID (starts with `bc_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "broadcast_id"
        ]
      },
      "returns": "The broadcast.",
      "example": {
        "broadcast_id": "bc_123"
      },
      "http": {
        "method": "GET",
        "path": "/broadcasts/{broadcast_id}"
      }
    },
    {
      "name": "update_broadcast",
      "title": "Edit a draft broadcast",
      "group": "campaigns",
      "description": "Campaigns: Change any field of an unscheduled draft broadcast (content, audience, tracking, web). A scheduled draft must be unscheduled first (unschedule_broadcast); sent or sending broadcasts cannot be edited.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Edit a draft broadcast"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "broadcast_id": {
            "type": "string",
            "description": "Broadcast ID (starts with `bc_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          },
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Internal name."
          },
          "list_id": {
            "type": "string",
            "description": "The list to send to."
          },
          "from": {
            "type": "string",
            "description": "Sender on a verified domain.",
            "maxLength": 320
          },
          "reply_to": {
            "type": "string",
            "description": "Reply-To address.",
            "maxLength": 320
          },
          "subject": {
            "type": "string",
            "description": "Subject line.",
            "maxLength": 998
          },
          "preview_text": {
            "type": "string",
            "description": "Inbox preview text.",
            "maxLength": 300
          },
          "html": {
            "type": "string",
            "description": "HTML body."
          },
          "text": {
            "type": "string",
            "description": "Plain-text body."
          },
          "template": {
            "type": [
              "object",
              "null"
            ],
            "description": "A published hosted template, or null to remove it.",
            "properties": {
              "id": {
                "type": "string"
              },
              "key": {
                "type": "string"
              },
              "version_id": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "markdown": {
            "type": "string",
            "description": "Markdown body instead of `html`: converted to a block document and rendered with the workspace design (get_newsletter_settings). Merge tags allowed. Not combinable with `html` or `content`.",
            "maxLength": 1000000
          },
          "content": {
            "type": [
              "object",
              "null"
            ],
            "description": "Block document ({\"type\": \"doc\", \"content\": [...]}, the dashboard editor's format: paragraph, heading, bulletList, orderedList, blockquote, image, button, callout, horizontalRule, codeBlock). Rendered with the workspace design unless `html` is also sent."
          },
          "editor": {
            "type": "string",
            "description": "Which editor the dashboard opens: `html` or `blocks`. Set automatically for `markdown` and `content`.",
            "enum": [
              "html",
              "blocks"
            ]
          },
          "audience": {
            "type": "object",
            "description": "Who gets it, within the list. Subscribed, non-dormant members only.",
            "properties": {
              "segment_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Only list members matching this segment (`seg_…`), or null for the whole list."
              },
              "order": {
                "type": "string",
                "description": "With a `limit`: `signup` (default) or `engaged` (most engaged first).",
                "enum": [
                  "signup",
                  "engaged"
                ]
              },
              "limit": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Send to at most this many people (send_broadcast_to_more sends to more later), or null for everyone.",
                "minimum": 1,
                "maximum": 10000000
              }
            },
            "additionalProperties": false
          },
          "tracking": {
            "type": "object",
            "description": "Open and click tracking, both on by default. Opens are estimates (bot-filtered pixel loads), never proof that someone read the email.",
            "properties": {
              "opens": {
                "type": "boolean",
                "description": "Add an open pixel."
              },
              "clicks": {
                "type": "boolean",
                "description": "Rewrite links to signed SendHQ redirects (the unsubscribe link never is)."
              }
            },
            "additionalProperties": false
          },
          "web": {
            "type": "object",
            "description": "Publish this issue on the list's newsletter site (see create_list `site`) once it is sent.",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "Publish it."
              },
              "slug": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Issue address; defaults to the subject.",
                "maxLength": 100
              },
              "pinned": {
                "type": "boolean",
                "description": "Keep it at the top of the site."
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false,
        "required": [
          "broadcast_id"
        ]
      },
      "returns": "The updated draft.",
      "example": {
        "broadcast_id": "bc_123",
        "subject": "October product update"
      },
      "http": {
        "method": "PATCH",
        "path": "/broadcasts/{broadcast_id}",
        "body": [
          "name",
          "list_id",
          "from",
          "reply_to",
          "subject",
          "preview_text",
          "html",
          "text",
          "template",
          "markdown",
          "content",
          "editor",
          "audience",
          "tracking",
          "web"
        ]
      }
    },
    {
      "name": "delete_broadcast",
      "title": "Delete a draft broadcast",
      "group": "campaigns",
      "description": "DESTRUCTIVE: permanently delete a draft broadcast. Broadcasts that were sent cannot be deleted. Part of Campaigns.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Delete a draft broadcast"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "broadcast_id": {
            "type": "string",
            "description": "Broadcast ID (starts with `bc_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "broadcast_id"
        ]
      },
      "returns": "{ok: true}.",
      "example": {
        "broadcast_id": "bc_123"
      },
      "http": {
        "method": "DELETE",
        "path": "/broadcasts/{broadcast_id}"
      }
    },
    {
      "name": "send_broadcast",
      "title": "Send a broadcast",
      "group": "campaigns",
      "description": "SENDS REAL EMAIL to the broadcast's audience: every subscribed, non-dormant member of its list, narrowed by its segment and limit. Only call it when the user asked to send this broadcast now. Each message goes through the normal checks (verified domain, marketing plan, suppressions, unsubscribes, reputation, daily and monthly limits) and carries one-click unsubscribe from this list; members that cannot be mailed are skipped. Each contact is sent at most once. Delivery continues in the background: poll get_broadcast for totals and get_broadcast_report for engagement. A scheduled broadcast fails with 409 until unscheduled. Unpaid workspaces (integration trial) can send only to the account email. Pass `idempotency_key` so a retry cannot start the send twice. Part of Campaigns.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": true,
        "title": "Send a broadcast"
      },
      "sends_email": true,
      "inputSchema": {
        "type": "object",
        "properties": {
          "broadcast_id": {
            "type": "string",
            "description": "Broadcast ID (starts with `bc_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          },
          "idempotency_key": {
            "type": "string",
            "description": "Idempotency-Key header (max 200 chars). Reuse it only to retry this exact request.",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "additionalProperties": false,
        "required": [
          "broadcast_id"
        ]
      },
      "returns": "The broadcast with status `sending` and totals.",
      "example": {
        "broadcast_id": "bc_123",
        "idempotency_key": "october-update"
      },
      "http": {
        "method": "POST",
        "path": "/broadcasts/{broadcast_id}/send",
        "idempotency": true
      }
    },
    {
      "name": "cancel_broadcast",
      "title": "Cancel a broadcast",
      "group": "campaigns",
      "description": "DESTRUCTIVE: stop a draft or sending broadcast for good. Recipients not yet sent are marked skipped; messages already handed to the provider are not recalled. Part of Campaigns.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Cancel a broadcast"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "broadcast_id": {
            "type": "string",
            "description": "Broadcast ID (starts with `bc_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false,
        "required": [
          "broadcast_id"
        ]
      },
      "returns": "The cancelled broadcast with totals.",
      "example": {
        "broadcast_id": "bc_123"
      },
      "http": {
        "method": "POST",
        "path": "/broadcasts/{broadcast_id}/cancel"
      }
    },
    {
      "name": "list_broadcast_recipients",
      "title": "List broadcast recipients",
      "group": "campaigns",
      "description": "Campaigns: Per-recipient outcomes and engagement of a broadcast: queued, sending, sent, held, skipped (with the reason), or failed (with the error), the inbox provider, delivered/opened/clicked/bounced/complained/unsubscribed times, and the email ID to inspect delivery events with list_email_events. Filter by outcome, by `activity` (who opened, clicked, did not open, ...), or by email. Opens are bot-filtered estimates, never proof of reading. Paginated.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "List broadcast recipients"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "broadcast_id": {
            "type": "string",
            "description": "Broadcast ID (starts with `bc_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          },
          "status": {
            "type": "string",
            "description": "Only recipients with this outcome.",
            "enum": [
              "queued",
              "sending",
              "sent",
              "held",
              "skipped",
              "failed"
            ]
          },
          "activity": {
            "type": "string",
            "description": "Only recipients who did this.",
            "enum": [
              "opened",
              "clicked",
              "not_opened",
              "not_delivered",
              "bounced",
              "complained",
              "unsubscribed"
            ]
          },
          "query": {
            "type": "string",
            "description": "Recipient email contains this text.",
            "maxLength": 200
          },
          "include": {
            "type": "string",
            "description": "`links` adds the links each recipient clicked (implied by `activity: clicked`).",
            "enum": [
              "links"
            ]
          },
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false,
        "required": [
          "broadcast_id"
        ]
      },
      "returns": "{data: [{contactId, email, status, skipReason, emailId, error, provider, deliveredAt, openedAt, clickedAt, opens, clicks, bouncedAt, complainedAt, unsubscribedAt, links?}], count, totals, pagination}.",
      "example": {
        "broadcast_id": "bc_123",
        "status": "failed"
      },
      "http": {
        "method": "GET",
        "path": "/broadcasts/{broadcast_id}/recipients",
        "query": [
          "status",
          "activity",
          "query",
          "include"
        ],
        "pagination": "server"
      }
    },
    {
      "name": "check_broadcast",
      "title": "Run a broadcast's pre-send checks",
      "group": "campaigns",
      "description": "Campaigns: The review list shown before sending: sender verification, subject, preview text, content, audience size, size against Gmail's 102 KB clipping limit, postal address, merge tags without data or fallback, empty or shortened links, image descriptions, placeholder text, spam-prone wording, the trial's own-address rule, and whether a test was sent. `ready` is false while any check has level `block`; schedule_broadcast refuses then. Fix `warn` items or tell the user about them.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Run a broadcast's pre-send checks"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "broadcast_id": {
            "type": "string",
            "description": "Broadcast ID (starts with `bc_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "required": [
          "broadcast_id"
        ],
        "additionalProperties": false
      },
      "returns": "{ready, checks: [{id, level: ok|warn|block, label, detail}], audience: {total, matching}}.",
      "example": {
        "broadcast_id": "bc_123"
      },
      "http": {
        "method": "GET",
        "path": "/broadcasts/{broadcast_id}/checks"
      }
    },
    {
      "name": "send_broadcast_test",
      "title": "Send a broadcast test",
      "group": "campaigns",
      "description": "SENDS REAL EMAIL: a copy of the draft marked `[Test]` to up to 5 addresses (default: the saved test recipients, or the account email), with merge tags filled from `contact_id` or a sample contact. Never goes to the list. Only send to addresses the user gave or owns. Limited to 100 test sends a day. Template broadcasts are tested with send_template_test. Part of Campaigns.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": true,
        "title": "Send a broadcast test"
      },
      "sends_email": true,
      "inputSchema": {
        "type": "object",
        "properties": {
          "broadcast_id": {
            "type": "string",
            "description": "Broadcast ID (starts with `bc_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          },
          "to": {
            "type": "array",
            "description": "Test recipients (up to 5).",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 320
            },
            "minItems": 1,
            "maxItems": 5
          },
          "contact_id": {
            "type": "string",
            "description": "Fill merge tags from this contact (`ct_…`).",
            "maxLength": 320
          },
          "remember": {
            "type": "boolean",
            "description": "Save `to` as the default test recipients."
          }
        },
        "required": [
          "broadcast_id"
        ],
        "additionalProperties": false
      },
      "returns": "{data: [{to, id, status: sent|failed, error?}]}.",
      "example": {
        "broadcast_id": "bc_123",
        "to": [
          "owner@example.com"
        ]
      },
      "http": {
        "method": "POST",
        "path": "/broadcasts/{broadcast_id}/test",
        "body": [
          "to",
          "contact_id",
          "remember"
        ]
      }
    },
    {
      "name": "schedule_broadcast",
      "title": "Schedule a broadcast",
      "group": "campaigns",
      "description": "SENDS REAL EMAIL at `scheduled_at` to the broadcast's audience, with the same checks as send_broadcast. Only call it when the user asked to send this broadcast at that time. The pre-send checks run now (422 with `checks` if one blocks). It starts within about a minute of the time; if it can no longer send then, it returns to a draft with the reason in `lastError`. A scheduled draft cannot be edited until unschedule_broadcast. Part of Campaigns.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true,
        "title": "Schedule a broadcast"
      },
      "sends_email": true,
      "inputSchema": {
        "type": "object",
        "properties": {
          "broadcast_id": {
            "type": "string",
            "description": "Broadcast ID (starts with `bc_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          },
          "scheduled_at": {
            "type": "string",
            "description": "When to send: ISO 8601 date-time with a timezone, at least a minute and at most a year ahead, e.g. `2026-11-10T09:00:00Z`.",
            "minLength": 10,
            "maxLength": 40
          }
        },
        "required": [
          "broadcast_id",
          "scheduled_at"
        ],
        "additionalProperties": false
      },
      "returns": "The broadcast with `scheduledAt`.",
      "example": {
        "broadcast_id": "bc_123",
        "scheduled_at": "2026-11-10T09:00:00Z"
      },
      "http": {
        "method": "POST",
        "path": "/broadcasts/{broadcast_id}/schedule",
        "body": [
          "scheduled_at"
        ]
      }
    },
    {
      "name": "unschedule_broadcast",
      "title": "Unschedule a broadcast",
      "group": "campaigns",
      "description": "Campaigns: Return a scheduled broadcast to an editable draft so it does not send. Fails with 409 when it is not scheduled.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Unschedule a broadcast"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "broadcast_id": {
            "type": "string",
            "description": "Broadcast ID (starts with `bc_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "required": [
          "broadcast_id"
        ],
        "additionalProperties": false
      },
      "returns": "The draft broadcast.",
      "example": {
        "broadcast_id": "bc_123"
      },
      "http": {
        "method": "POST",
        "path": "/broadcasts/{broadcast_id}/unschedule"
      }
    },
    {
      "name": "duplicate_broadcast",
      "title": "Duplicate a broadcast",
      "group": "campaigns",
      "description": "Campaigns: Copy any broadcast (draft, sent, or cancelled) into a new draft named `<name> (copy)` with the same list, sender, content, audience, and tracking settings. Nothing is sent.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Duplicate a broadcast"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "broadcast_id": {
            "type": "string",
            "description": "Broadcast ID (starts with `bc_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "required": [
          "broadcast_id"
        ],
        "additionalProperties": false
      },
      "returns": "The new draft broadcast.",
      "example": {
        "broadcast_id": "bc_123"
      },
      "http": {
        "method": "POST",
        "path": "/broadcasts/{broadcast_id}/duplicate"
      }
    },
    {
      "name": "send_broadcast_to_more",
      "title": "Send a broadcast to more people",
      "group": "campaigns",
      "description": "SENDS REAL EMAIL: sends a sent or sending broadcast to up to `limit` more people in its audience who have not received it (the rest of a limited audience, or people who joined since), in its audience order. Only call it when the user asked for this. Same checks as send_broadcast; each contact still gets it at most once. Fails with 422 when everyone already got it. Pass `idempotency_key` so a retry cannot add people twice. Part of Campaigns.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": true,
        "title": "Send a broadcast to more people"
      },
      "sends_email": true,
      "inputSchema": {
        "type": "object",
        "properties": {
          "broadcast_id": {
            "type": "string",
            "description": "Broadcast ID (starts with `bc_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          },
          "limit": {
            "type": "integer",
            "description": "How many more people at most.",
            "minimum": 1,
            "maximum": 10000000
          },
          "idempotency_key": {
            "type": "string",
            "description": "Idempotency-Key header (max 200 chars). Reuse it only to retry this exact request.",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "required": [
          "broadcast_id",
          "limit"
        ],
        "additionalProperties": false
      },
      "returns": "{added, broadcast}.",
      "example": {
        "broadcast_id": "bc_123",
        "limit": 500,
        "idempotency_key": "october-update-more-1"
      },
      "http": {
        "method": "POST",
        "path": "/broadcasts/{broadcast_id}/send-more",
        "body": [
          "limit"
        ],
        "idempotency": true
      }
    },
    {
      "name": "get_broadcast_report",
      "title": "Get a broadcast report",
      "group": "campaigns",
      "description": "Campaigns: Engagement for a sending or sent broadcast: unique and total opens and clicks, bounces, complaints, and unsubscribes with rates in percent, the same per inbox provider, clicks per link, first opens and clicks by hour, and the average of the previous five broadcasts. Opens are estimates: automated requests (scanners, link previews, privacy prefetching) are counted only in `machine`. Never claim that a person read the email. Fails with 409 for a draft.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Get a broadcast report"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "broadcast_id": {
            "type": "string",
            "description": "Broadcast ID (starts with `bc_`), as returned by a list or create tool.",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "required": [
          "broadcast_id"
        ],
        "additionalProperties": false
      },
      "returns": "{stats: {sent, delivered, opened, clicked, bounced, complained, unsubscribed, opens, clicks, rates}, providers, links, timeline, average, machine, tracking, totals, remaining}.",
      "example": {
        "broadcast_id": "bc_123"
      },
      "http": {
        "method": "GET",
        "path": "/broadcasts/{broadcast_id}/report"
      }
    },
    {
      "name": "get_newsletter_settings",
      "title": "Get newsletter settings",
      "group": "campaigns",
      "description": "Campaigns: The postal address added to every marketing email footer, the design (accent color, font, alignment) used for Markdown and block content, list cleanup settings, and default test recipients.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Get newsletter settings"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "returns": "{postalAddress, design: {accentColor, font, align}, cleanup: {enabled, afterSends, quietDays, subject, body, from}, testRecipients}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/newsletter-settings"
      }
    },
    {
      "name": "update_newsletter_settings",
      "title": "Update newsletter settings",
      "group": "campaigns",
      "description": "Campaigns: Change the postal address (required in marketing email by CAN-SPAM and CASL), design, list cleanup, or default test recipients. Omitted keys keep their value. List cleanup is on by default and sends email automatically: a subscriber who got `afterSends` broadcasts in a row without opening or clicking and has been quiet for `quietDays` gets one \"still want these?\" email; a week later those who did not confirm become dormant (kept, but skipped by broadcasts). Confirm with the user before turning it on or changing its email.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Update newsletter settings"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "postal_address": {
            "type": "string",
            "description": "Sender's postal address for the footer. Empty string removes it.",
            "maxLength": 300
          },
          "design": {
            "type": "object",
            "description": "Rendering design for Markdown and block content.",
            "properties": {
              "accentColor": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Hex color like `#0a7d4f`, or null for the default.",
                "pattern": "^#[0-9a-fA-F]{6}$"
              },
              "font": {
                "type": "string",
                "enum": [
                  "sans",
                  "serif",
                  "mono"
                ],
                "description": "Font family."
              },
              "align": {
                "type": "string",
                "enum": [
                  "left",
                  "center"
                ],
                "description": "Text alignment."
              }
            },
            "additionalProperties": false
          },
          "cleanup": {
            "type": "object",
            "description": "List cleanup of readers who stopped opening.",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "Turn list cleanup on or off."
              },
              "afterSends": {
                "type": "integer",
                "description": "Broadcasts in a row without an open or click (3-50).",
                "minimum": 3,
                "maximum": 50
              },
              "quietDays": {
                "type": "integer",
                "description": "Days without engagement (30-730).",
                "minimum": 30,
                "maximum": 730
              },
              "subject": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Subject of the cleanup email; merge tags allowed.",
                "maxLength": 200
              },
              "body": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Body text of the cleanup email.",
                "maxLength": 2000
              },
              "from": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Sender on a verified domain. Defaults to the last sent broadcast's sender.",
                "maxLength": 320
              }
            },
            "additionalProperties": false
          },
          "test_recipients": {
            "type": "array",
            "description": "Default addresses for send_broadcast_test (up to 5).",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 320
            },
            "maxItems": 5
          }
        },
        "additionalProperties": false
      },
      "returns": "The updated settings.",
      "example": {
        "postal_address": "Acme Inc., 1 Main St, Springfield",
        "design": {
          "accentColor": "#0a7d4f"
        }
      },
      "http": {
        "method": "PATCH",
        "path": "/newsletter-settings",
        "body": [
          "postal_address:postalAddress",
          "design",
          "cleanup",
          "test_recipients:testRecipients"
        ]
      }
    },
    {
      "name": "get_campaign_overview",
      "title": "Get campaign overview",
      "group": "campaigns",
      "description": "Campaigns: Subscriber growth and recent results for the last `days` (7-365, default 30): active, dormant, and pending subscribers, joined and left, a daily series, and the six latest broadcasts with open and click rates (bot-filtered estimates) and their average.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Get campaign overview"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "days": {
            "type": "integer",
            "description": "Window in days, 7 to 365. Defaults to 30.",
            "minimum": 7,
            "maximum": 365
          }
        },
        "additionalProperties": false
      },
      "returns": "{subscribers: {active, dormant, pending, joined, left}, series: [{day, subscribers, joined, left}], recent: [{id, name, subject, status, startedAt, sent, openRate, clickRate}], averages}.",
      "example": {
        "days": 30
      },
      "http": {
        "method": "GET",
        "path": "/campaigns/overview",
        "query": [
          "days"
        ]
      }
    },
    {
      "name": "list_uploaded_images",
      "title": "List uploaded images",
      "group": "campaigns",
      "description": "Campaigns: The workspace's 60 most recent editor image uploads with their public URLs (https://sendhq.cc/i/<id>), to reuse in broadcast HTML, Markdown, or image blocks. Uploading needs the dashboard or the REST API (raw image body). Paginated.",
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "List uploaded images"
      },
      "sends_email": false,
      "inputSchema": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Page size. Defaults to 50.",
            "minimum": 1,
            "maximum": 200,
            "default": 50
          },
          "offset": {
            "type": "integer",
            "description": "Number of records to skip. Use `pagination.next_offset` from the previous page.",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": false
      },
      "returns": "{data: [{id, url, width, height, size, filename, createdAt}], pagination}.",
      "example": {},
      "http": {
        "method": "GET",
        "path": "/uploads/images",
        "pagination": "client"
      }
    }
  ],
  "documentation": "https://sendhq.cc/docs/mcp",
  "install": {
    "unix": "curl -fsSL https://downloads.sendhq.cc/install.sh | sh",
    "windows": "irm https://downloads.sendhq.cc/install.ps1 | iex",
    "run": "sendhq mcp",
    "env": {
      "SENDHQ_API_KEY": "required",
      "SENDHQ_API_BASE_URL": "optional, default https://sendhq.cc/api/v1",
      "SENDHQ_MCP_READ_ONLY": "optional"
    }
  }
}
