{
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "send_sms",
        "description": "Send an SMS message to a phone number using Sendly. Returns the message ID and delivery status.",
        "parameters": {
          "type": "object",
          "properties": {
            "to": {
              "type": "string",
              "description": "Recipient phone number in E.164 format (e.g., +14155552671)"
            },
            "text": {
              "type": "string",
              "description": "Message body to send"
            },
            "from": {
              "type": "string",
              "description": "Sender phone number or alphanumeric ID. Uses your default number if omitted."
            },
            "messageType": {
              "type": "string",
              "enum": ["marketing", "transactional"],
              "description": "Message type. Use transactional for OTP, alerts, and receipts. Defaults to marketing."
            },
            "metadata": {
              "type": "object",
              "description": "Optional key-value data to attach to the message (max 4KB)"
            }
          },
          "required": ["to", "text"]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "send_otp",
        "description": "Send a one-time password (OTP) verification code to a phone number. Returns a verification ID used to check the code.",
        "parameters": {
          "type": "object",
          "properties": {
            "to": {
              "type": "string",
              "description": "Recipient phone number in E.164 format (e.g., +14155552671)"
            },
            "app_name": {
              "type": "string",
              "description": "Your app or service name shown in the verification message (e.g., 'MyApp')"
            },
            "code_length": {
              "type": "integer",
              "description": "Number of digits in the OTP code. Defaults to 6.",
              "minimum": 4,
              "maximum": 10
            },
            "timeout_secs": {
              "type": "integer",
              "description": "Seconds until the code expires. Defaults to 300 (5 minutes)."
            }
          },
          "required": ["to"]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "check_otp",
        "description": "Verify an OTP code entered by the user. Returns the verification status (verified or failed).",
        "parameters": {
          "type": "object",
          "properties": {
            "verification_id": {
              "type": "string",
              "description": "The verification ID returned by send_otp"
            },
            "code": {
              "type": "string",
              "description": "The code entered by the user"
            }
          },
          "required": ["verification_id", "code"]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "list_messages",
        "description": "Retrieve recent outbound and inbound SMS messages. Supports pagination and full-text search.",
        "parameters": {
          "type": "object",
          "properties": {
            "limit": {
              "type": "integer",
              "description": "Number of messages to return (max 100). Defaults to 50.",
              "maximum": 100
            },
            "offset": {
              "type": "integer",
              "description": "Number of messages to skip for pagination. Defaults to 0."
            },
            "q": {
              "type": "string",
              "description": "Full-text search query to filter messages by content"
            },
            "sandbox": {
              "type": "boolean",
              "description": "Set to true to retrieve sandbox/test messages instead of production messages"
            }
          },
          "required": []
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "get_balance",
        "description": "Check your Sendly credit balance. Each credit is worth $0.01. US/CA SMS costs 2 credits per message.",
        "parameters": {
          "type": "object",
          "properties": {},
          "required": []
        }
      }
    }
  ]
}
