ig_logout
Log out from an IG Trading account securely via the IG Trading MCP server. Use this tool to close active sessions and manage account access.
Instructions
Logout from IG Trading account
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/services/mcp-service.js:545-554 (handler)MCP tool handler for ig_logout that delegates to IGService.logout() and formats the response.case 'ig_logout': await igService.logout(); return { content: [ { type: 'text', text: 'Successfully logged out', }, ], };
- src/services/mcp-service.js:84-91 (registration)Tool registration in TOOLS array, including name, description, and empty input schema.{ name: 'ig_logout', description: 'Logout from IG Trading account', inputSchema: { type: 'object', properties: {}, }, },
- src/services/ig-service.js:55-65 (helper)IGService.logout method: core implementation that calls IG API DELETE /session and clears session tokens.async logout() { try { const response = await this.apiClient.delete('/session'); config.clearSessionTokens(); logger.info('Logout successful'); return response; } catch (error) { logger.error('Logout failed:', error.message); throw error; } }