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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| error | No | ||
| id | No | ||
| username | No | ||
| first_name | No | ||
| is_bot | No | ||
| can_join_groups | No | ||
| can_read_all_group_messages | No | ||
| supports_inline_queries | No |
Implementation Reference
- aiogram_mcp/tools/users.py:44-62 (handler)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 - aiogram_mcp/tools/users.py:14-21 (schema)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 - aiogram_mcp/tools/users.py:44-62 (registration)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 - aiogram_mcp/server.py:89-90 (registration)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) - aiogram_mcp/permissions.py:19-19 (helper)Permission mapping: get_bot_info requires READ level, defined in TOOL_PERMISSIONS dict.
"get_bot_info": PermissionLevel.READ,