disconnect
Terminate the connection to Interactive Brokers TWS or IB Gateway, ending all active data streams and trading sessions.
Instructions
Disconnect from TWS/Gateway.
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/ib_async_mcp/server.py:462-466 (handler)The handler logic for the 'disconnect' tool, which sets the 'ib' client to None and calls its disconnect method.
if name == "disconnect": if ib is not None: ib.disconnect() ib = None return {"status": "disconnected"} - src/ib_async_mcp/server.py:80-84 (registration)Registration of the 'disconnect' tool with name, description, and empty input schema.
Tool( name="disconnect", description="Disconnect from TWS/Gateway.", inputSchema={"type": "object", "properties": {}}, ),