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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server-api-handlers.ts:253-265 (handler)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();
- src/server.ts:767-767 (helper)Binds the apiHandlers.handleApiLogout function to the server's instance method handleApiLogout for use in tool dispatching.private handleApiLogout = apiHandlers.handleApiLogout.bind(this);