send_video
Send video messages via WhatsApp Business API to share visual content with optional captions, footers, and reply functionality.
Instructions
Send a video message.
Args: to: Phone number or WhatsApp ID video: Video URL or media ID caption: Optional video caption footer: Optional footer text reply_to_message_id: Message ID to reply to
Returns: Dictionary with success status and message ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | ||
| video | Yes | ||
| caption | No | ||
| footer | No | ||
| reply_to_message_id | No |
Implementation Reference
- tools/messaging.py:101-137 (handler)The complete implementation of the send_video tool - includes both the @mcp.tool() registration decorator and the handler function that sends video messages via WhatsApp API@mcp.tool() async def send_video( to: str, video: str, caption: Optional[str] = None, footer: Optional[str] = None, *, reply_to_message_id: Optional[str] = None, ) -> dict: """ Send a video message. Args: to: Phone number or WhatsApp ID video: Video URL or media ID caption: Optional video caption footer: Optional footer text reply_to_message_id: Message ID to reply to Returns: Dictionary with success status and message ID """ try: result = wa_client.send_video( to=to, video=video, caption=caption, footer=footer, reply_to_message_id=reply_to_message_id, ) logger.info(f"Video sent to {to}") message_id = getattr(result, 'id', str(result)) if result else None return {"success": True, "message_id": message_id} except Exception as e: logger.error(f"Failed to send video: {str(e)}") return {"success": False, "error": str(e)}
- tools/messaging.py:101-109 (registration)Tool registration via @mcp.tool() decorator with function signature defining input parameters and return type@mcp.tool() async def send_video( to: str, video: str, caption: Optional[str] = None, footer: Optional[str] = None, *, reply_to_message_id: Optional[str] = None, ) -> dict:
- tools/messaging.py:110-122 (schema)Schema documentation defining the tool's purpose, input parameters, and return structure""" Send a video message. Args: to: Phone number or WhatsApp ID video: Video URL or media ID caption: Optional video caption footer: Optional footer text reply_to_message_id: Message ID to reply to Returns: Dictionary with success status and message ID """