get_entity_by_id
Retrieve Telegram user or chat details by providing their unique identifier to access profile information within the current session.
Instructions
Get an entity from the current session
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No |
Implementation Reference
- mcp-server/mcp-server.py:41-41 (registration)Registers the 'get_entity_by_id' tool with the MCP server using the @mcp.tool decorator, specifying its name and description.
@mcp.tool(name="get_entity_by_id", description="Get an entity from the current session") - mcp-server/mcp-server.py:42-43 (handler)The handler function for the 'get_entity_by_id' tool. It performs an HTTP GET request to retrieve the entity data by ID from the HTTP server and returns it as a dictionary.
async def get_entity_by_id(id=int | str) -> dict: return get(f"{api_endpoint}get_entity/{id}").json()