get_account_info
Retrieve details of the current Telegram session, including user ID and phone number.
Instructions
Returns information about the currently logged-in Telegram account.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/telegram_mcp/server.py:12-19 (handler)The handler function for the 'get_account_info' tool. It is decorated with @mcp.tool(), calls telegram_service.get_me(), and returns formatted account info.
@mcp.tool() async def get_account_info(): """ Returns information about the currently logged-in Telegram account. """ logger.info("Executing get_account_info tool") me = await telegram_service.get_me() return f"Logged in as: {me.first_name} (@{me.username}) [ID: {me.id}]" - src/telegram_mcp/server.py:12-13 (registration)The tool is registered via the @mcp.tool() decorator on the get_account_info function, which registers it with the FastMCP server.
@mcp.tool() async def get_account_info(): - The get_me() helper method in TelegramService that calls the Telethon client's get_me() to retrieve the current user info.
async def get_me(self): await self.start() if self.client: return await self.client.get_me() return None