Skip to main content
Glama

send_video

Send video files to Telegram chats with optional captions, formatting, and notification controls using the aiogram-mcp server.

Instructions

Send a video to a Telegram chat.

Args: chat_id: Target chat ID. video_url: URL or file_id of the video. caption: Optional caption. parse_mode: HTML, Markdown, MarkdownV2, or None. duration: Duration in seconds. disable_notification: Send silently.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chat_idYes
video_urlYes
captionNo
parse_modeNoHTML
durationNo
disable_notificationNo

Implementation Reference

  • The handler function for the 'send_video' tool, which takes chat_id, video_url, and optional parameters to send a video using the aiogram bot context.
    async def send_video(
        chat_id: int,
        video_url: str,
        caption: str | None = None,
        parse_mode: str | None = "HTML",
        duration: int | None = None,
        disable_notification: bool = False,
    ) -> SendMediaResult:
        """Send a video to a Telegram chat.
    
        Args:
            chat_id: Target chat ID.
            video_url: URL or file_id of the video.
            caption: Optional caption.
            parse_mode: HTML, Markdown, MarkdownV2, or None.
            duration: Duration in seconds.
            disable_notification: Send silently.
        """
        if not ctx.is_chat_allowed(chat_id):
            result = SendMediaResult(ok=False, error=f"Chat {chat_id} is not allowed.")
            if ctx.audit_logger:
                ctx.audit_logger.log(
                    "send_video",
                    {"chat_id": chat_id, "video_url": video_url},
                    result.ok,
                    result.error,
                )
            return result
    
        try:
            if ctx.rate_limiter:
                await ctx.rate_limiter.acquire()
            msg = await ctx.bot.send_video(
                chat_id=chat_id,
                video=video_url,
                caption=caption,
                parse_mode=normalize_parse_mode(parse_mode),
                duration=duration,
                disable_notification=disable_notification,
            )
            result = SendMediaResult(ok=True, message_id=msg.message_id, chat_id=msg.chat.id)
        except ValueError as exc:
            result = SendMediaResult(ok=False, error=str(exc))
        except (TelegramBadRequest, TelegramForbiddenError) as exc:
            result = SendMediaResult(ok=False, error=str(exc))
    
        if ctx.audit_logger:
            ctx.audit_logger.log(
                "send_video",
                {"chat_id": chat_id, "video_url": video_url},
                result.ok,
                result.error,
            )
        return result
  • Registration logic for the 'send_video' tool within the register_media_tools function.
    if allowed_tools is None or "send_video" in allowed_tools:

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Py2755/aiogram-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server