Skip to main content
Glama

set_chat_description

Update the description of a Telegram group or channel by providing its chat ID and the new description text.

Instructions

Change the description of a group or channel.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chat_idYes
descriptionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
errorNo

Implementation Reference

  • The tool handler function that executes set_chat_description logic: validates chat permission, applies rate limiting, calls bot.set_chat_description, and returns OkResult.
    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))
    
        if ctx.audit_logger:
            ctx.audit_logger.log(
                "set_chat_description",
                {"chat_id": chat_id, "description": description},
                result.ok,
                result.error,
            )
        return result
  • The response schema (OkResult) used by set_chat_description, inheriting ToolResponse with ok/error fields.
    class OkResult(ToolResponse):
        """Result for tools that return only ok/error (delete, pin, etc.)."""
    
        pass
  • Base pydantic model for all tool responses, providing the ok and error fields.
    class ToolResponse(BaseModel):
        """Base model for all tool results. ok=True on success, ok=False with error on failure."""
    
        ok: bool
        error: str | None = None
  • Registration of the tool via @mcp.tool decorator, guarded by allowed_tools check, within register_chat_tools().
    if allowed_tools is None or "set_chat_description" in allowed_tools:
    
        @mcp.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))
    
            if ctx.audit_logger:
                ctx.audit_logger.log(
                    "set_chat_description",
                    {"chat_id": chat_id, "description": description},
                    result.ok,
                    result.error,
                )
            return result
  • Permission mapping assigning set_chat_description to MODERATION level.
    "set_chat_description": PermissionLevel.MODERATION,
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears full responsibility for behavioral disclosure. It only states the core operation ('change description') without mentioning side effects, permission requirements, rate limits, or any post-condition effects. For a mutation tool, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence with no waste. However, it lacks structure (e.g., bullet points or sections) that could improve readability for complex parameter details. Slightly under-utilizes brevity for clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema, the description does not need to detail return values, but it fails to address typical concerns for a mutation tool (e.g., success/failure behavior, irreversible changes). The tool's role among many sibling chat operations is not contextualized.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must compensate by explaining parameter meanings. It only mentions 'description of a group or channel' but does not clarify the 'chat_id' parameter or the format of 'description'. Parameter semantics are largely inferred from field names alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('change') and the resource ('description of a group or channel'), making the tool's purpose instantly understandable. It distinguishes itself from sibling tool 'set_chat_title' which deals with a different attribute.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is used for changing descriptions of groups or channels but provides no explicit guidance on when to use it versus alternatives like 'edit_message' or 'set_chat_title'. No when-not-to-use or prerequisite information is given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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