api_logout
Disconnect from Telegram API to terminate active sessions and ensure secure account management by ending API connections.
Instructions
Disconnect from Telegram API
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "api_logout"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server-api-handlers.ts:253-265 (handler)The handler function that executes the api_logout tool logic: disconnects the Telegram API scraper instance if it exists and 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)Registration of the 'api_logout' tool in the getTools() method, 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)Dispatch case in the tool call handler that routes 'api_logout' calls to the bound handleApiLogout method.
case 'api_logout': return await this.handleApiLogout(); - src/server.ts:767-767 (helper)Binding of the apiHandlers.handleApiLogout method to the class instance for use in tool dispatching.
private handleApiLogout = apiHandlers.handleApiLogout.bind(this);