send_msg_to_multiple_num_using_approved_template
Send WhatsApp messages to multiple contacts using approved templates for bulk communication and marketing campaigns.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| template_id | Yes | ||
| contacts | Yes |
Implementation Reference
- src/titan_mind/server.py:233-247 (handler)The MCP tool handler for 'send_msg_to_multiple_num_using_approved_template'. Decorated with @mcp.tool() which registers it, and implements logic by calling the helper function with the provided template_id and list of contacts.@mcp.tool() def send_msg_to_multiple_num_using_approved_template( template_id: int, contacts: list[Contact], ) -> Optional[Dict[str, Any]]: (""" sends a message to a phone number using an approved whatsapp template. Args: template_id (str): id of the whatsapp message template, it is not the template name. contacts (Contact): a contact has three attributes: country_code_alpha(like "IN" for india), country_code(like "91") and phone_without_dialer_code """ + _titan_mind_product_whatsapp_channel_messaging_functionality_and_workflow) return titan_mind_functions.send_message_to_a_number_using_approved_template( template_id, contacts )
- src/titan_mind/server.py:233-247 (registration)The @mcp.tool() decorator registers the tool 'send_msg_to_multiple_num_using_approved_template' with the MCP server.@mcp.tool() def send_msg_to_multiple_num_using_approved_template( template_id: int, contacts: list[Contact], ) -> Optional[Dict[str, Any]]: (""" sends a message to a phone number using an approved whatsapp template. Args: template_id (str): id of the whatsapp message template, it is not the template name. contacts (Contact): a contact has three attributes: country_code_alpha(like "IN" for india), country_code(like "91") and phone_without_dialer_code """ + _titan_mind_product_whatsapp_channel_messaging_functionality_and_workflow) return titan_mind_functions.send_message_to_a_number_using_approved_template( template_id, contacts )
- Core helper function implementing the API call to send WhatsApp template messages to multiple contacts using the TitanMind API.def send_message_to_a_number_using_approved_template( template_id: int, contacts: list[Contact], ): return asdict( TitanMindAPINetworking().make_request( endpoint=f"whatsapp/message/send-template/", payload={ "recipients": [contact.model_dump() for contact in contacts], "template": template_id, }, success_message="message sent request created.", method=HTTPMethod.POST, ) )
- Pydantic schema/model for Contact used in the tool's 'contacts' parameter, defining structure for recipient phone details.class Contact(BaseModel): country_code_alpha: str country_code: str phone_without_country_code: str