send_sticker
Send a sticker to a Telegram chat using file ID or URL. Control silent sending with the disable_notification option.
Instructions
Send a sticker to a Telegram chat.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat_id | Yes | Target chat ID. | |
| sticker | Yes | File ID or URL of the sticker (WEBP/TGS/WEBM). | |
| disable_notification | No | Send silently. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| error | No | ||
| message_id | No | ||
| chat_id | No |
Implementation Reference
- aiogram_mcp/tools/media.py:318-360 (handler)The main handler function for the 'send_sticker' tool. It validates chat permissions, acquires rate limiter, calls bot.send_sticker(), and returns a SendMediaResult. Registered via @mcp.tool decorator inside register_media_tools().
async def send_sticker( chat_id: int, sticker: str, disable_notification: bool = False, ) -> SendMediaResult: """Send a sticker to a Telegram chat. Args: chat_id: Target chat ID. sticker: File ID or URL of the sticker (WEBP/TGS/WEBM). 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_sticker", {"chat_id": chat_id, "sticker": sticker}, result.ok, result.error, ) return result try: if ctx.rate_limiter: await ctx.rate_limiter.acquire() msg = await ctx.bot.send_sticker( chat_id=chat_id, sticker=sticker, disable_notification=disable_notification, ) result = SendMediaResult(ok=True, message_id=msg.message_id, chat_id=msg.chat.id) except (TelegramBadRequest, TelegramForbiddenError) as exc: result = SendMediaResult(ok=False, error=str(exc)) if ctx.audit_logger: ctx.audit_logger.log( "send_sticker", {"chat_id": chat_id, "sticker": sticker}, result.ok, result.error, ) return result - aiogram_mcp/tools/media.py:14-16 (schema)The SendMediaResult response model used as the return type for send_sticker. Contains optional message_id and chat_id fields.
class SendMediaResult(ToolResponse): message_id: int | None = None chat_id: int | None = None - aiogram_mcp/tools/media.py:315-318 (registration)The conditional registration of 'send_sticker' as an MCP tool inside register_media_tools(). It checks if allowed_tools is None or contains 'send_sticker'.
if allowed_tools is None or "send_sticker" in allowed_tools: @mcp.tool async def send_sticker( - aiogram_mcp/permissions.py:36-36 (helper)Permission mapping for 'send_sticker' - it requires MESSAGING permission level.
"send_sticker": PermissionLevel.MESSAGING,