disconnect
Close the IMAP connection to free resources and end email session management.
Instructions
Close IMAP connection
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": "disconnect"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/imap_mcp/imap_client.py:63-77 (handler)The actual implementation of the disconnect logic in the IMAP client.
def disconnect(self) -> bool: """Close IMAP connection.""" # Stop watcher if running if self.watcher and self.watching: self.watcher.stop() self.watching = False if self.client: try: self.client.logout() except Exception: pass self.client = None self.current_mailbox = None return True - src/imap_mcp/server.py:59-63 (registration)Tool registration for 'disconnect'.
make_tool( "disconnect", "Close IMAP connection", {}, ), - src/imap_mcp/server.py:486-487 (handler)MCP server handler for the 'disconnect' tool calling the imap_client method.
elif name == "disconnect": return imap_client.disconnect()