Skip to main content
Glama
prem-research

Telegram MCP Server

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

TableJSON Schema
NameRequiredDescriptionDefault
idNo

Implementation Reference

  • 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")
  • 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()

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/prem-research/telegram-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server