Skip to main content
Glama

set_chat_description

Update group or channel descriptions in Telegram bots to maintain accurate information and improve user engagement.

Instructions

Change the description of a group or channel.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chat_idYes
descriptionYes

Implementation Reference

  • The handler function for set_chat_description tool.
    async def set_chat_description(chat_id: int, description: str) -> OkResult:
        """Change the description of a group or channel."""
        if not ctx.is_chat_allowed(chat_id):
            result = OkResult(ok=False, error=f"Chat {chat_id} is not allowed.")
            if ctx.audit_logger:
                ctx.audit_logger.log(
                    "set_chat_description",
                    {"chat_id": chat_id, "description": description},
                    result.ok,
                    result.error,
                )
            return result
    
        try:
            if ctx.rate_limiter:
                await ctx.rate_limiter.acquire()
            await ctx.bot.set_chat_description(chat_id=chat_id, description=description)
            result = OkResult(ok=True)
        except (TelegramBadRequest, TelegramForbiddenError) as exc:
            result = OkResult(ok=False, error=str(exc))
  • Registration of the set_chat_description tool using the @mcp.tool decorator.
    @mcp.tool
    async def set_chat_description(chat_id: int, description: str) -> OkResult:

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