Skip to main content
Glama

api_logout

Terminate active Telegram API session to securely disconnect from Telegram channels and groups managed through the MCP server. Ensures clean session closure.

Instructions

Disconnect from Telegram API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'api_logout' tool. It disconnects the Telegram API scraper instance if it exists and clears the reference, then returns a success message.
    async handleApiLogout(this: any): Promise<any> { if (this._apiScraper) { await this._apiScraper.disconnect(); this._apiScraper = null; } return { content: [{ type: 'text', text: '✅ Disconnected from Telegram API' }] }; }
  • src/server.ts:373-381 (registration)
    Registers the 'api_logout' tool in the MCP server's tool list via getTools(), including its name, description, and empty input schema.
    { name: 'api_logout', description: 'Disconnect from Telegram API', inputSchema: { type: 'object', properties: {}, required: [] } }
  • src/server.ts:107-108 (registration)
    Dispatches 'api_logout' tool calls in the CallToolRequestSchema handler switch statement to the bound handleApiLogout method.
    case 'api_logout': return await this.handleApiLogout();
  • Binds the apiHandlers.handleApiLogout function to the server's instance method handleApiLogout for use in tool dispatching.
    private handleApiLogout = apiHandlers.handleApiLogout.bind(this);

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/DLHellMe/telegram-mcp-server'

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