Skip to main content
Glama

get_bot_info

Retrieve metadata of the Telegram bot, including name, username, and description. Enables verification of bot identity and status without external calls.

Instructions

Return metadata about the current Telegram bot.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
errorNo
idNo
usernameNo
first_nameNo
is_botNo
can_join_groupsNo
can_read_all_group_messagesNo
supports_inline_queriesNo

Implementation Reference

  • The get_bot_info tool handler: calls ctx.bot.get_me() and returns bot metadata (id, username, first_name, is_bot, can_join_groups, can_read_all_group_messages, supports_inline_queries) wrapped in a BotInfoResult.
    if allowed_tools is None or "get_bot_info" in allowed_tools:
    
        @mcp.tool
        async def get_bot_info() -> BotInfoResult:
            """Return metadata about the current Telegram bot."""
            me = await ctx.bot.get_me()
            result = BotInfoResult(
                ok=True,
                id=me.id,
                username=me.username,
                first_name=me.first_name,
                is_bot=me.is_bot,
                can_join_groups=me.can_join_groups,
                can_read_all_group_messages=me.can_read_all_group_messages,
                supports_inline_queries=me.supports_inline_queries,
            )
            if ctx.audit_logger:
                ctx.audit_logger.log("get_bot_info", {}, result.ok, result.error)
            return result
  • The BotInfoResult Pydantic model used as the return type for get_bot_info tool.
    class BotInfoResult(ToolResponse):
        id: int | None = None
        username: str | None = None
        first_name: str | None = None
        is_bot: bool | None = None
        can_join_groups: bool | None = None
        can_read_all_group_messages: bool | None = None
        supports_inline_queries: bool | None = None
  • Registration via @mcp.tool decorator inside register_user_tools(), gated by allowed_tools check.
    if allowed_tools is None or "get_bot_info" in allowed_tools:
    
        @mcp.tool
        async def get_bot_info() -> BotInfoResult:
            """Return metadata about the current Telegram bot."""
            me = await ctx.bot.get_me()
            result = BotInfoResult(
                ok=True,
                id=me.id,
                username=me.username,
                first_name=me.first_name,
                is_bot=me.is_bot,
                can_join_groups=me.can_join_groups,
                can_read_all_group_messages=me.can_read_all_group_messages,
                supports_inline_queries=me.supports_inline_queries,
            )
            if ctx.audit_logger:
                ctx.audit_logger.log("get_bot_info", {}, result.ok, result.error)
            return result
  • register_user_tools is called from AiogramMCP._register_tools() in the server class, which wires up the tool registration.
    register_user_tools(self._mcp, self._ctx, allowed_tools=at)
    register_chat_tools(self._mcp, self._ctx, allowed_tools=at)
  • Permission mapping: get_bot_info requires READ level, defined in TOOL_PERMISSIONS dict.
    "get_bot_info": PermissionLevel.READ,
Behavior3/5

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

The description implies a read operation with no side effects, but does not explicitly state safety constraints. With no annotations, it would benefit from mentioning idempotency or lack of destructive behavior.

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

Conciseness5/5

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

A single, concise sentence that efficiently communicates the tool's function with no unnecessary words.

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

Completeness4/5

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

The description is sufficient for a no-parameter tool, and an output schema exists to detail the return metadata. It does not need to elaborate further.

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

Parameters4/5

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

The tool has no parameters and the input schema covers 100% of them (none). The description adds no parameter info, which is acceptable since there are no parameters to describe.

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 verb 'Return' and the resource 'metadata about the current Telegram bot'. It distinguishes itself from sibling tools that deal with chat info or messages.

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?

No explicit guidance on when to use this tool vs alternatives like get_chat_info. However, the purpose is clear enough that an agent can infer it's solely for bot metadata.

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