Preview: SendMock has no stable release yet. These docs follow develop.

MCP reference

Outcome rules tools

sendmock_outcome_rule_create

Add an email outcome rule. Add an SMS outcome rule.

Toolset rules.

    InputTypeDescription
    channelrequiredstring
    Picks what to do. email: Add an email outcome rule. sms: Add an SMS outcome rule.One of: email, smsExample: email
    patternrequiredstring
    Exact address, or * wildcards, e.g. *@bounce.qa.test.Example: *@bounce.qa.test
    outcomerequiredstring
    What happens to a matching email: delivered, hard_bounce, soft_bounce, complaint, unsubscribe or reject (refused during SMTP RCPT and the HTTP send).One of: delivered, hard_bounce, soft_bounce, complaint, unsubscribe, rejectExample: hard_bounce
    smtp_codestring
    SMTP reply for bounces and rejects, e.g. 550 5.1.1.Example: 550 5.1.1
    diagnosticstring
    The diagnostic text sent with the SMTP code.Example: user unknown
    noterequiredstring
    Why the rule exists, shown in the list.Example: Bounce every QA signup
    is_enabledrequiredboolean
    Off rules are kept but skipped.Example: true
    match_fieldstring
    Match the pattern against the recipient (to) or the sender (from).One of: to, fromExample: to
    error_codestring
    Required for reject, undelivered and failed.Example: 30003
    delay_secondsnumber
    Required for delayed_delivery.Example: 30

    Example call

    {
      "name": "sendmock_outcome_rule_create",
      "arguments": {
        "channel": "email",
        "pattern": "*@bounce.qa.test",
        "outcome": "hard_bounce",
        "note": "Bounce every QA signup",
        "is_enabled": true,
        "smtp_code": "550 5.1.1",
        "diagnostic": "user unknown"
      }
    }

    Result: EmailOutcomeRule | SmsOutcomeRule

    API
    channel: emailPOST/api/v1/outcome-rules/emailchannel: smsPOST/api/v1/outcome-rules/sms
    CLI
    sendmock outcome-rule email create, sendmock outcome-rule sms create
    In the app
    Settings > Email > Custom outcome addresses > Add address; Settings > SMS > Custom outcome numbers > Add number

    sendmock_outcome_rule_delete

    Delete an email outcome rule. Delete an SMS outcome rule.

    Toolset rules.

    • Destructive
    • Idempotent
    InputTypeDescription
    channelrequiredstring
    Picks what to do. email: Delete an email outcome rule. sms: Delete an SMS outcome rule.One of: email, smsExample: email
    rule_idrequiredstring
    The rule's ID, from the list of rules of the same kind.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

    Example call

    {
      "name": "sendmock_outcome_rule_delete",
      "arguments": {
        "channel": "email",
        "rule_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D"
      }
    }

    Result: nothing

    API
    channel: emailDELETE/api/v1/outcome-rules/email/{ruleId}channel: smsDELETE/api/v1/outcome-rules/sms/{ruleId}
    CLI
    sendmock outcome-rule email delete <ruleId>, sendmock outcome-rule sms delete <ruleId>
    In the app
    Settings > Email > Custom outcome addresses > Delete; Settings > SMS > Custom outcome numbers > Delete

    sendmock_outcome_rule_list

    Email outcome rules, checked from top to bottom. SMS outcome rules, checked from top to bottom.

    Toolset rules.

    • Read only
    InputTypeDescription
    channelrequiredstring
    Picks what to do. email: Email outcome rules, checked from top to bottom. sms: SMS outcome rules, checked from top to bottom.One of: email, smsExample: email

    Example call

    {
      "name": "sendmock_outcome_rule_list",
      "arguments": {
        "channel": "email"
      }
    }

    Result: EmailOutcomeRule[] | SmsOutcomeRule[]

    API
    channel: emailGET/api/v1/outcome-rules/emailchannel: smsGET/api/v1/outcome-rules/sms
    CLI
    sendmock outcome-rule email list, sendmock outcome-rule sms list
    In the app
    Settings > Email > Custom outcome addresses; Settings > SMS > Custom outcome numbers

    sendmock_outcome_rule_move

    Move an email outcome rule up or down. Move an SMS outcome rule up or down.

    Toolset rules.

      InputTypeDescription
      channelrequiredstring
      Picks what to do. email: Move an email outcome rule up or down. sms: Move an SMS outcome rule up or down.One of: email, smsExample: email
      rule_idrequiredstring
      The rule's ID, from the list of rules of the same kind.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      directionrequiredstring
      up moves the rule one place earlier in the order, down one place later.One of: up, downExample: up

      Example call

      {
        "name": "sendmock_outcome_rule_move",
        "arguments": {
          "channel": "email",
          "rule_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D",
          "direction": "up"
        }
      }

      Result: EmailOutcomeRule[] | SmsOutcomeRule[]

      API
      channel: emailPOST/api/v1/outcome-rules/email/{ruleId}/movechannel: smsPOST/api/v1/outcome-rules/sms/{ruleId}/move
      CLI
      sendmock outcome-rule email move <ruleId>, sendmock outcome-rule sms move <ruleId>
      In the app
      Settings > Email > Custom outcome addresses > Move up, Move down; Settings > SMS > Custom outcome numbers > Move up, Move down

      sendmock_outcome_rule_test

      Which custom rule, magic address or profile decides an address's outcome. Which custom rule, magic number or profile decides a number's outcome.

      Toolset rules.

      • Read only
      InputTypeDescription
      channelrequiredstring
      Picks what to do. email: Which custom rule, magic address or profile decides an address's outcome. sms: Which custom rule, magic number or profile decides a number's outcome.One of: email, smsExample: email
      addressstring
      The address to test against the outcome rules and magic addresses.Example: [email protected]
      numberstring
      The number to test against the outcome rules and Twilio's magic numbers.Example: +15005550001
      match_fieldstring
      Whether the number is the message's recipient (to) or sender (from).One of: to, fromExample: to

      Example call

      {
        "name": "sendmock_outcome_rule_test",
        "arguments": {
          "channel": "email",
          "address": "[email protected]"
        }
      }

      Result: OutcomeTestResult

      API
      channel: emailPOST/api/v1/outcome-rules/email/testchannel: smsPOST/api/v1/outcome-rules/sms/test
      CLI
      sendmock outcome-rule email test <address>, sendmock outcome-rule sms test <number>
      In the app
      Settings > Email > Test an address; Settings > SMS > Test a number

      sendmock_outcome_rule_update

      Change an email outcome rule; send only the changed keys. Change an SMS outcome rule; send only the changed keys.

      Toolset rules.

      • Idempotent
      InputTypeDescription
      channelrequiredstring
      Picks what to do. email: Change an email outcome rule; send only the changed keys. sms: Change an SMS outcome rule; send only the changed keys.One of: email, smsExample: email
      rule_idrequiredstring
      The rule's ID, from the list of rules of the same kind.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      patternstring
      Exact address, or * wildcards, e.g. *@bounce.qa.test.Example: *@bounce.qa.test
      outcomestring
      What happens to a matching email: delivered, hard_bounce, soft_bounce, complaint, unsubscribe or reject (refused during SMTP RCPT and the HTTP send).One of: delivered, hard_bounce, soft_bounce, complaint, unsubscribe, rejectExample: hard_bounce
      smtp_codestring
      SMTP reply for bounces and rejects, e.g. 550 5.1.1.Example: 550 5.1.1
      diagnosticstring
      The diagnostic text sent with the SMTP code.Example: user unknown
      notestring
      Why the rule exists, shown in the list.Example: Bounce every QA signup
      is_enabledboolean
      Off rules are kept but skipped.Example: true
      match_fieldstring
      Match the pattern against the recipient (to) or the sender (from).One of: to, fromExample: to
      error_codestring
      Required for reject, undelivered and failed.Example: 30003
      delay_secondsnumber
      Required for delayed_delivery.Example: 30

      Example call

      {
        "name": "sendmock_outcome_rule_update",
        "arguments": {
          "channel": "email",
          "rule_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D",
          "pattern": "*@bounce.qa.test",
          "outcome": "hard_bounce"
        }
      }

      Result: EmailOutcomeRule | SmsOutcomeRule

      API
      channel: emailPATCH/api/v1/outcome-rules/email/{ruleId}channel: smsPATCH/api/v1/outcome-rules/sms/{ruleId}
      CLI
      sendmock outcome-rule email update <ruleId>, sendmock outcome-rule sms update <ruleId>
      In the app
      Settings > Email > Custom outcome addresses > Edit, enabled switch; Settings > SMS > Custom outcome numbers > Edit, enabled switch