{"success":true,"tools":[{"name":"send_email","description":"Send an email with text or HTML content","inputSchema":{"type":"object","properties":{"to":{"type":"array","items":{"type":"string"},"description":"Array of recipient email addresses"},"cc":{"type":"array","items":{"type":"string"},"description":"Array of CC recipient email addresses","optional":true},"bcc":{"type":"array","items":{"type":"string"},"description":"Array of BCC recipient email addresses","optional":true},"subject":{"type":"string","description":"Email subject line"},"text":{"type":"string","description":"Plain text content of the email"},"html":{"type":"string","description":"HTML content of the email","optional":true},"attachments":{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string"},"content":{"type":"string"},"encoding":{"type":"string","default":"base64"}}},"description":"Array of file attachments","optional":true},"provider":{"type":"string","description":"Send via a specific provider instead of the default (e.g. smtp, mailgun, sendgrid, ses, gmail, resend). Requires that provider's credentials in env.","optional":true},"from":{"type":"string","description":"Personal account address to send from. If set and matching account has personal SMTP/IMAP credentials (via set_personal_email_credentials), sends via that account and IMAP-APPENDs a copy to its Sent folder. If exactly one personal account exists and from is omitted, it is used. If multiple personal accounts exist and from is omitted, the call errors and lists choices.","optional":true},"bulk_mode":{"type":"string","enum":["individual","bcc","to"],"description":"Required when sending to multiple recipients. \"individual\": sends a separate email to each recipient (safest). \"bcc\": puts first recipient in TO:, rest in BCC. \"to\": puts all in TO: (exposes addresses — use only when intended, e.g. team threads).","optional":true}},"required":["to","subject","text"]}},{"name":"send_template_email","description":"Send an email using a predefined template","inputSchema":{"type":"object","properties":{"to":{"type":"array","items":{"type":"string"},"description":"Array of recipient email addresses"},"template":{"type":"string","description":"Template name or path"},"variables":{"type":"object","description":"Template variables to replace","additionalProperties":true},"subject":{"type":"string","description":"Email subject (can override template subject)","optional":true},"provider":{"type":"string","description":"Send via a specific provider instead of the default (e.g. smtp, mailgun, sendgrid, ses, gmail, resend)","optional":true},"bulk_mode":{"type":"string","enum":["individual","bcc","to"],"description":"Required when sending to multiple recipients. \"individual\": sends a separate email to each recipient (safest). \"bcc\": puts first recipient in TO:, rest in BCC. \"to\": puts all in TO: (exposes addresses — use only when intended).","optional":true}},"required":["to","template"]}},{"name":"validate_email","description":"Validate email addresses and check deliverability","inputSchema":{"type":"object","properties":{"emails":{"type":"array","items":{"type":"string"},"description":"Array of email addresses to validate"},"check_mx":{"type":"boolean","description":"Check MX records for domain","default":true},"check_smtp":{"type":"boolean","description":"Perform SMTP validation","default":false}},"required":["emails"]}},{"name":"get_email_usage","description":"Get email usage statistics — delivery rate, bounce rate, per-domain breakdown, top bounce reasons. Reads from persistent stats.","inputSchema":{"type":"object","properties":{"period":{"type":"string","enum":["hour","day","week","month"],"description":"Time period for usage statistics","default":"day"},"domain":{"type":"string","description":"Filter stats by domain","optional":true},"account":{"type":"string","description":"Filter stats by account address","optional":true}}}},{"name":"verify_email_setup","description":"Verify IP whitelisting and email provider configuration","inputSchema":{"type":"object","properties":{"provider":{"type":"string","enum":["sendgrid","mailgun","ses","resend","all"],"description":"Email provider to verify, or \"all\" for all configured providers"},"test_email":{"type":"string","format":"email","description":"Optional test email address to verify delivery"},"include_dns":{"type":"boolean","default":false,"description":"Include DNS record verification"},"domain":{"type":"string","description":"Domain to check for DNS records (required if include_dns is true)"}},"required":["provider"]}},{"name":"list_email_accounts","description":"List all configured IMAP email accounts. Shows default and named accounts (work, personal, etc.).","inputSchema":{"type":"object","properties":{}}},{"name":"read_inbox","description":"Read emails from an inbox via IMAP with filtering options. If IMAP is configured in .env, no credentials needed. Use \"account\" to pick a named account (work, personal, etc.).","inputSchema":{"type":"object","properties":{"account":{"type":"string","description":"Named account to read from (e.g. \"work\", \"personal\"). Omit for default account.","optional":true},"imap_config":{"type":"object","description":"Optional if IMAP is configured in .env (IMAP_HOST, IMAP_EMAIL, IMAP_PASSWORD)","properties":{"host":{"type":"string","description":"IMAP server hostname (e.g., imap.gmail.com)"},"port":{"type":"number","description":"IMAP server port (default: 993 for SSL)","default":993},"secure":{"type":"boolean","description":"Use SSL/TLS connection","default":true},"email":{"type":"string","description":"Email address for authentication"},"password":{"type":"string","description":"Password or app-specific password"}}},"filter":{"type":"object","properties":{"mailbox":{"type":"string","description":"Mailbox to read from","default":"INBOX"},"limit":{"type":"number","description":"Maximum number of emails to read","default":10,"minimum":1,"maximum":100},"from":{"type":"string","description":"Filter by sender email address"},"to":{"type":"string","description":"Filter by recipient email address"},"subject_contains":{"type":"string","description":"Filter by text in subject line"},"body_contains":{"type":"string","description":"Filter by text in email body"},"since":{"type":"string","format":"date","description":"Only emails after this date (YYYY-MM-DD)"},"before":{"type":"string","format":"date","description":"Only emails before this date (YYYY-MM-DD)"},"unread_only":{"type":"boolean","description":"Only return unread emails","default":false},"flagged":{"type":"boolean","description":"Only return flagged emails"}}},"options":{"type":"object","properties":{"include_body":{"type":"boolean","description":"Include email body content","default":true},"include_attachments":{"type":"boolean","description":"Include attachment information","default":false},"mark_as_read":{"type":"boolean","description":"Mark emails as read after fetching","default":false}}}}}},{"name":"get_mailbox_status","description":"Get status information for an email mailbox. If IMAP is configured in .env, no credentials needed. Use \"account\" to pick a named account.","inputSchema":{"type":"object","properties":{"account":{"type":"string","description":"Named account (e.g. \"work\", \"personal\"). Omit for default.","optional":true},"imap_config":{"type":"object","properties":{"host":{"type":"string"},"port":{"type":"number","default":993},"secure":{"type":"boolean","default":true},"email":{"type":"string","format":"email"},"password":{"type":"string"}},"required":["host","email","password"]},"mailbox":{"type":"string","description":"Mailbox to check","default":"INBOX"}}}},{"name":"list_mailboxes","description":"List all available mailboxes for an email account. If IMAP is configured in .env, no credentials needed. Use \"account\" to pick a named account.","inputSchema":{"type":"object","properties":{"account":{"type":"string","description":"Named account (e.g. \"work\", \"personal\"). Omit for default.","optional":true},"imap_config":{"type":"object","properties":{"host":{"type":"string"},"port":{"type":"number","default":993},"secure":{"type":"boolean","default":true},"email":{"type":"string","format":"email"},"password":{"type":"string"}},"required":["host","email","password"]}}}},{"name":"start_smtp_receiver","description":"Start the SMTP server to receive forwarded corporate emails","inputSchema":{"type":"object","properties":{"port":{"type":"number","description":"Port to listen on (default: 2525)","default":2525},"allowedForwarders":{"type":"array","items":{"type":"string"},"description":"IP addresses allowed to forward emails (empty = allow all)","default":[]},"receivingDomains":{"type":"array","items":{"type":"string"},"description":"Domains to accept emails for (empty = accept all)","default":[]},"enableThreading":{"type":"boolean","description":"Enable conversation threading","default":true}}}},{"name":"stop_smtp_receiver","description":"Stop the SMTP forward receiver server","inputSchema":{"type":"object","properties":{}}},{"name":"get_smtp_receiver_status","description":"Get the current status of the SMTP forward receiver","inputSchema":{"type":"object","properties":{}}},{"name":"get_forwarded_emails","description":"Retrieve forwarded emails with optional filtering","inputSchema":{"type":"object","properties":{"originalSender":{"type":"string","description":"Filter by original sender email address"},"threadId":{"type":"string","description":"Filter by conversation thread ID"},"since":{"type":"string","description":"Filter emails since this date (ISO string)"},"limit":{"type":"number","description":"Maximum number of emails to return","default":50}}}},{"name":"get_conversation_threads","description":"Get conversation threads with forwarded emails","inputSchema":{"type":"object","properties":{"participant":{"type":"string","description":"Filter threads by participant email address"},"subject":{"type":"string","description":"Filter threads by subject content"},"since":{"type":"string","description":"Filter threads active since this date (ISO string)"},"limit":{"type":"number","description":"Maximum number of threads to return","default":20}}}},{"name":"get_conversation_context","description":"Get full conversation context for a specific thread","inputSchema":{"type":"object","properties":{"threadId":{"type":"string","description":"Thread ID to get conversation for"},"maxEmails":{"type":"number","description":"Maximum number of emails to include in context","default":10}},"required":["threadId"]}},{"name":"get_threads_for_sender","description":"Get all conversation threads involving a specific sender","inputSchema":{"type":"object","properties":{"senderAddress":{"type":"string","description":"Email address of the sender"}},"required":["senderAddress"]}},{"name":"check_email_config","description":"Check if email providers are configured, guide setup if needed","inputSchema":{"type":"object","properties":{}}},{"name":"configure_mailgun","description":"Configure Mailgun email provider with step-by-step guidance","inputSchema":{"type":"object","properties":{"api_key":{"type":"string","description":"Mailgun API Key (starts with \"key-\")"},"domain":{"type":"string","description":"Mailgun domain (e.g., mg.yourdomain.com)"},"from_email":{"type":"string","description":"From email address (e.g., noreply@yourdomain.com)"}},"required":["api_key","domain","from_email"]}},{"name":"test_email_config","description":"Test email configuration by sending a test email","inputSchema":{"type":"object","properties":{"test_email":{"type":"string","description":"Email address to send test email to (optional, defaults to from_email)"}}}},{"name":"create_mailbox","description":"Create a new local mailbox for receiving email (autonomous mode). Each address gets its own inbox accessible via MCP tools.","inputSchema":{"type":"object","properties":{"address":{"type":"string","description":"Email address for the mailbox (e.g. sales@company.com)"},"display_name":{"type":"string","description":"Display name for the mailbox","optional":true}},"required":["address"]}},{"name":"delete_mailbox","description":"Delete a local mailbox and all its stored emails (autonomous mode)","inputSchema":{"type":"object","properties":{"address":{"type":"string","description":"Email address of the mailbox to delete"}},"required":["address"]}},{"name":"list_local_mailboxes","description":"List all local mailboxes on this server (autonomous mode)","inputSchema":{"type":"object","properties":{}}},{"name":"request_email_ip","description":"Request a dedicated WireGuard IP for email sending. Submits to the provisioning queue.","inputSchema":{"type":"object","properties":{"email_domain":{"type":"string","description":"Your email domain (e.g. company.com)"},"account_id":{"type":"string","description":"Optional account identifier","optional":true}},"required":["email_domain"]}},{"name":"check_ip_status","description":"Check the status of a pending WireGuard IP provisioning request","inputSchema":{"type":"object","properties":{"request_id":{"type":"string","description":"Request ID from request_email_ip (omit to check saved request)","optional":true}}}},{"name":"get_dns_records","description":"Generate all required DNS records (A, MX, SPF, DKIM, DMARC) for autonomous email. Outputs copyable records for your DNS provider.","inputSchema":{"type":"object","properties":{"domain":{"type":"string","description":"Your email domain (e.g. company.com)"},"ipv4":{"type":"string","description":"Your dedicated IPv4 address (from WireGuard provisioning)"},"mail_hostname":{"type":"string","description":"Mail server hostname (default: mail.domain)","optional":true},"dkim_selector":{"type":"string","description":"DKIM selector (default: emailmcp)","optional":true},"dmarc_policy":{"type":"string","enum":["none","quarantine","reject"],"description":"DMARC policy (default: reject)","optional":true}},"required":["domain","ipv4"]}},{"name":"verify_autonomous_setup","description":"Verify that autonomous email is properly configured: DNS records, DKIM, SMTP send/receive","inputSchema":{"type":"object","properties":{"domain":{"type":"string","description":"Your email domain to verify"}},"required":["domain"]}},{"name":"setup_autonomous_security","description":"Auto-configure DKIM, SPF, and DMARC for autonomous email. Generates DKIM keys, creates DNS records, and outputs everything needed.","inputSchema":{"type":"object","properties":{"domain":{"type":"string","description":"Your email domain"},"ipv4":{"type":"string","description":"Your dedicated IPv4 address"},"dkim_selector":{"type":"string","description":"DKIM selector (default: emailmcp)","optional":true},"dmarc_policy":{"type":"string","enum":["none","quarantine","reject"],"description":"DMARC policy (default: reject)","optional":true}},"required":["domain","ipv4"]}},{"name":"create_email_rule","description":"Create a rule that triggers actions when incoming emails match conditions. Actions: forward, auto_reply, webhook, flag, move, mcp_tool, log, reject.","inputSchema":{"type":"object","properties":{"name":{"type":"string","description":"Rule name (unique)"},"description":{"type":"string","description":"What this rule does","optional":true},"priority":{"type":"number","description":"Priority (lower = evaluated first, default 100)","optional":true},"match":{"type":"object","description":"Match conditions (ALL must match). Use from, domain, subject, subject_regex, body_contains, has_attachments, to, header.","properties":{"from":{"type":"string","description":"Sender address or pattern (*@domain.com)"},"domain":{"type":"string","description":"Sender domain"},"to":{"type":"string","description":"Recipient address or pattern"},"subject":{"type":"string","description":"Subject contains text"},"subject_regex":{"type":"string","description":"Subject regex pattern"},"body_contains":{"type":"string","description":"Body contains text"},"has_attachments":{"type":"boolean","description":"Has attachments"}}},"actions":{"type":"array","description":"Actions to execute when rule matches","items":{"type":"object","properties":{"type":{"type":"string","enum":["forward","auto_reply","webhook","flag","move","mcp_tool","log","reject"]},"to":{"type":"string","description":"For forward: recipient address"},"body":{"type":"string","description":"For auto_reply: reply body text"},"subject":{"type":"string","description":"For auto_reply: reply subject"},"url":{"type":"string","description":"For webhook: URL to POST to"},"flag":{"type":"string","description":"For flag: flag name (default: important)"},"folder":{"type":"string","description":"For move: target folder"},"tool":{"type":"string","description":"For mcp_tool: MCP tool name to invoke"},"args":{"type":"object","description":"For mcp_tool: arguments to pass","additionalProperties":true},"reason":{"type":"string","description":"For reject: rejection reason"}},"required":["type"]}},"stop":{"type":"boolean","description":"Stop processing further rules after this one matches (default: false)","optional":true}},"required":["name","match","actions"]}},{"name":"list_email_rules","description":"List all email rules with their match conditions, actions, and hit counts","inputSchema":{"type":"object","properties":{}}},{"name":"delete_email_rule","description":"Delete an email rule by ID","inputSchema":{"type":"object","properties":{"rule_id":{"type":"string","description":"Rule ID to delete"}},"required":["rule_id"]}},{"name":"update_email_rule","description":"Update an existing email rule (enable/disable, change match/actions/priority)","inputSchema":{"type":"object","properties":{"rule_id":{"type":"string","description":"Rule ID to update"},"enabled":{"type":"boolean","description":"Enable or disable the rule","optional":true},"priority":{"type":"number","description":"New priority","optional":true},"match":{"type":"object","description":"New match conditions","optional":true},"actions":{"type":"array","description":"New actions","optional":true},"stop":{"type":"boolean","description":"Stop after match","optional":true}},"required":["rule_id"]}},{"name":"start_idle_watch","description":"Start real-time IMAP IDLE watching on email accounts. Get push notifications when new emails arrive. Works with Gmail, iCloud, Office365, etc.","inputSchema":{"type":"object","properties":{"account":{"type":"string","description":"Account name to watch (e.g. \"work\", \"personal\"). Omit to watch all configured accounts.","optional":true}}}},{"name":"stop_idle_watch","description":"Stop IMAP IDLE watching on an account (or all accounts)","inputSchema":{"type":"object","properties":{"account":{"type":"string","description":"Account to stop watching. Omit to stop all.","optional":true}}}},{"name":"get_idle_status","description":"Get status of IMAP IDLE watchers — which accounts are being watched, connection status, new email counts","inputSchema":{"type":"object","properties":{}}},{"name":"provision_start","description":"Phase 1: Create a cloud VPS with dedicated IP. Generates WireGuard config. Returns the IP and instructions to connect. Supports DigitalOcean, Vultr, Hetzner, OVH.","inputSchema":{"type":"object","properties":{"cloud_provider":{"type":"string","enum":["digitalocean","vultr","hetzner","ovh"],"description":"Cloud provider"},"cloud_api_key":{"type":"string","description":"Cloud provider API key"},"service_domain":{"type":"string","description":"Domain you own for the email service (e.g. emailrelay.xyz). NS will point here."},"region":{"type":"string","description":"Cloud region (e.g. nyc1, ewr, nbg1, GRA11). Omit for default.","optional":true}},"required":["cloud_provider","cloud_api_key","service_domain"]}},{"name":"provision_resume","description":"Resume provisioning from where you left off. Automatically detects the current phase and advances: WireGuard connection → DNS setup → TLS → verification. Run this after each user action (connecting WireGuard, adding DNS records).","inputSchema":{"type":"object","properties":{}}},{"name":"provision_status","description":"Show current provisioning state — which phases are complete, what to do next","inputSchema":{"type":"object","properties":{}}},{"name":"list_cloud_providers","description":"List supported cloud providers with pricing, regions, and PTR support info","inputSchema":{"type":"object","properties":{}}},{"name":"start_health_monitor","description":"Start monitoring the provisioned email server — checks tunnel, SMTP, DNS, and IP reputation every 60 seconds. Auto-restarts on failure.","inputSchema":{"type":"object","properties":{}}},{"name":"get_health_status","description":"Get current health status of the email server — tunnel, SMTP, DNS, IP blocklist checks","inputSchema":{"type":"object","properties":{}}},{"name":"add_sending_domain","description":"Add a customer sending domain. Generates DKIM keys and returns the 4 DNS records the customer needs to add. Works like SendGrid domain authentication — self-hosted.","inputSchema":{"type":"object","properties":{"domain":{"type":"string","description":"Customer domain (e.g. company.com)"}},"required":["domain"]}},{"name":"list_sending_domains","description":"List all configured sending domains with their verification status","inputSchema":{"type":"object","properties":{}}},{"name":"remove_sending_domain","description":"Remove a sending domain and its DKIM keys","inputSchema":{"type":"object","properties":{"domain":{"type":"string","description":"Customer domain to remove"}},"required":["domain"]}},{"name":"get_domain_dns_records","description":"Get the DNS records a customer needs to add for a sending domain","inputSchema":{"type":"object","properties":{"domain":{"type":"string","description":"Customer domain"}},"required":["domain"]}},{"name":"regenerate_zone_file","description":"Regenerate the complete DNS zone file for the service domain including all customer subdomains. Use after adding/removing domains.","inputSchema":{"type":"object","properties":{}}},{"name":"create_email_account","description":"Create an email account with SMTP credentials. Returns SMTP password once — save it. The account can then send/receive via this server.","inputSchema":{"type":"object","properties":{"address":{"type":"string","description":"Email address (e.g. sales@company.com)"},"display_name":{"type":"string","description":"Display name for the account","optional":true},"domain":{"type":"string","description":"Sending domain (auto-derived from address if omitted)","optional":true}},"required":["address"]}},{"name":"delete_email_account","description":"Delete an email account and revoke its SMTP credentials","inputSchema":{"type":"object","properties":{"address":{"type":"string","description":"Email address of the account to delete"}},"required":["address"]}},{"name":"list_email_accounts_managed","description":"List all email accounts with SMTP credentials (optionally filtered by domain)","inputSchema":{"type":"object","properties":{"domain":{"type":"string","description":"Filter by domain","optional":true}}}},{"name":"reset_account_password","description":"Reset the SMTP password for an email account. Returns new password once.","inputSchema":{"type":"object","properties":{"address":{"type":"string","description":"Email address of the account"}},"required":["address"]}},{"name":"start_domain_verification","description":"Begin a domain-verification window: temporarily set the target domain's MX to verify.setip.io, start (or reuse) the EmailMCP SMTP receiver on :25, and forward any inbound mail for *@domain to forward_to so a human can grab a verification code from the provider (Apple/Google/etc). Auto-tears down after ttl_minutes.","inputSchema":{"type":"object","properties":{"domain":{"type":"string","description":"Domain whose MX is being temporarily redirected (must be a POC we own in setipio-api)"},"forward_to":{"type":"string","description":"Address where verification mails are relayed in real time"},"ttl_minutes":{"type":"number","description":"Auto-teardown after this many minutes (default 60)"},"real_mx_target":{"type":"string","description":"Optional. If provided, on teardown the MX is set to this target (e.g. apple.com) instead of restoring the pre-window snapshot."}},"required":["domain","forward_to"]}},{"name":"stop_domain_verification","description":"Tear down an active domain-verification window: restore MX (snapshot or supplied real_mx_target), remove the per-domain forwarder. Stops the receiver if no other windows remain.","inputSchema":{"type":"object","properties":{"domain":{"type":"string","description":"Domain to tear down"},"real_mx_target":{"type":"string","description":"Optional final MX target (e.g. apple.com). Overrides the snapshot restore."}},"required":["domain"]}},{"name":"get_domain_verification_status","description":"Show active verification windows, the receiver state, and TTLs.","inputSchema":{"type":"object","properties":{}}},{"name":"get_domain_verification_emails","description":"List mails received in the verification window for a given domain (e.g. to find Apple's verification code without checking the forward_to mailbox).","inputSchema":{"type":"object","properties":{"domain":{"type":"string","description":"Domain to filter on"}},"required":["domain"]}},{"name":"set_personal_email_credentials","description":"Attach a personal account's own SMTP + IMAP credentials (iCloud, Gmail app password, Fastmail, Office365, etc.) to an existing account. Once set, send_email with from=<address> sends via that SMTP and IMAP-APPENDs a copy to its Sent folder. Passwords are AES-256-GCM encrypted at rest with EMAILMCP_SECRET.","inputSchema":{"type":"object","properties":{"address":{"type":"string","description":"Address of the existing account (must already be created via create_email_account)"},"smtp_host":{"type":"string","description":"e.g. smtp.mail.me.com (iCloud), smtp.gmail.com, smtp.fastmail.com"},"smtp_port":{"type":"number","description":"Default 587"},"smtp_user":{"type":"string","description":"SMTP username — usually the full email address"},"smtp_password":{"type":"string","description":"SMTP password or app-specific password"},"imap_host":{"type":"string","description":"e.g. imap.mail.me.com, imap.gmail.com, imap.fastmail.com"},"imap_port":{"type":"number","description":"Default 993"},"imap_user":{"type":"string","description":"IMAP username — usually the full email address"},"imap_password":{"type":"string","description":"IMAP password (often same as SMTP)"},"sent_folder":{"type":"string","description":"Override Sent folder name. Auto-discovered via SPECIAL-USE if omitted.","optional":true}},"required":["address","smtp_host","smtp_user","smtp_password","imap_host","imap_user","imap_password"]}},{"name":"get_suppression_list","description":"View all addresses on the bounce suppression list — these addresses will be rejected on send","inputSchema":{"type":"object","properties":{}}},{"name":"remove_from_suppression","description":"Remove an address from the bounce suppression list (manual override to allow sending again)","inputSchema":{"type":"object","properties":{"address":{"type":"string","description":"Email address to unblock"}},"required":["address"]}}]}