webull-openapi-mcp 1.2.3__tar.gz → 1.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/.env.example +1 -1
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/PKG-INFO +29 -38
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/README.md +27 -36
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/mcpb/build_manifest.py +1 -1
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/pyproject.toml +2 -2
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/server.json +2 -2
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_fundamental_screener_registration.py +3 -3
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_sdk_client.py +2 -2
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/__init__.py +1 -1
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/cli.py +1 -1
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/formatters.py +56 -9
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/region_config.py +5 -33
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/sdk_client.py +1 -19
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/trading/order.py +59 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/.github/workflows/pypi-ci.yml +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/.gitignore +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/DISCLAIMER.md +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/LICENSE +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/mcpb/.mcpbignore +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/mcpb/build.sh +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/mcpb/src/server.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/__init__.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_account_tools.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_audit.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_cli.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_config.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_errors.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_formatters.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_fundamental_tools.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_guards.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_instrument_tools.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_market_data_tools.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_property_audit.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_property_config.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_property_formatters.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_property_guards.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_property_sdk.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_property_server.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_screener_tools.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/tests/test_stock_order_tools.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/__main__.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/audit.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/config.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/constants.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/errors.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/guards.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/server.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/__init__.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/market_data/__init__.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/market_data/crypto.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/market_data/event.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/market_data/financial.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/market_data/fundamental.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/market_data/futures.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/market_data/option.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/market_data/screener.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/market_data/stock.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/market_data/watchlist.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/trading/__init__.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/trading/account.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/trading/assets.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/trading/crypto_order.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/trading/event_order.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/trading/futures_order.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/trading/instrument.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/trading/option_order.py +0 -0
- {webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/trading/stock_order.py +0 -0
|
@@ -20,7 +20,7 @@ WEBULL_APP_SECRET=
|
|
|
20
20
|
# Set to 'prod' for live trading (use with caution)
|
|
21
21
|
# WEBULL_ENVIRONMENT=uat
|
|
22
22
|
|
|
23
|
-
# Region ID: us, hk, jp, sg,
|
|
23
|
+
# Region ID: us, hk, jp, sg, my, uk, mx, br, or za
|
|
24
24
|
# Default: us
|
|
25
25
|
# WEBULL_REGION_ID=us
|
|
26
26
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: webull-openapi-mcp
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.4
|
|
4
4
|
Summary: MCP Server for Webull OpenAPI - enables AI assistants to securely access Webull trading and market data
|
|
5
5
|
Project-URL: Homepage, https://github.com/webull-inc/webull-openapi-mcp
|
|
6
6
|
Project-URL: Repository, https://github.com/webull-inc/webull-openapi-mcp
|
|
@@ -20,7 +20,7 @@ Requires-Python: <3.13,>=3.10
|
|
|
20
20
|
Requires-Dist: click
|
|
21
21
|
Requires-Dist: fastmcp==3.0.2
|
|
22
22
|
Requires-Dist: python-dotenv
|
|
23
|
-
Requires-Dist: webull-openapi-python-sdk==
|
|
23
|
+
Requires-Dist: webull-openapi-python-sdk==3.0.0
|
|
24
24
|
Provides-Extra: dev
|
|
25
25
|
Requires-Dist: hypothesis; extra == 'dev'
|
|
26
26
|
Requires-Dist: pytest; extra == 'dev'
|
|
@@ -49,7 +49,7 @@ See [DISCLAIMER.md](DISCLAIMER.md) for the full disclaimer.
|
|
|
49
49
|
|
|
50
50
|
## Features
|
|
51
51
|
|
|
52
|
-
- **Multi-Region Support** — US, HK, JP, SG,
|
|
52
|
+
- **Multi-Region Support** — US, HK, JP, SG, MY, UK, MX, BR, and ZA regions with region-specific order types, trading sessions, and validation
|
|
53
53
|
- **Market Data** — Real-time snapshots, tick data, quotes (depth), footprint, and OHLCV bars for stocks, options, futures, crypto, and event contracts
|
|
54
54
|
- **NOII Data** — Net Order Imbalance Indicator bars and snapshots for US stock opening/closing auctions
|
|
55
55
|
- **Screener** — Top gainers/losers, most active, market sectors, high dividend, and 52-week high/low rankings
|
|
@@ -146,12 +146,9 @@ Here are some prompts you can use with your AI assistant:
|
|
|
146
146
|
- HK: [developer.webull.hk](https://developer.webull.hk/apis/home)
|
|
147
147
|
- JP: [developer.webull.co.jp](https://developer.webull.co.jp/)
|
|
148
148
|
- SG: [developer.webull.com.sg](https://developer.webull.com.sg/apis/home)
|
|
149
|
-
- TH: [developer.webull.co.th](https://developer.webull.co.th/apis/home)
|
|
150
149
|
- MY: [developer.webull.com.my](https://developer.webull.com.my/apis/home)
|
|
151
150
|
- UK: [developer.webull-uk.com](https://developer.webull-uk.com/apis/home)
|
|
152
|
-
- EU: [developer.webull.eu](https://developer.webull.eu/apis/home)
|
|
153
151
|
- ZA: [developer.webull.co.za](https://developer.webull.co.za/apis/home)
|
|
154
|
-
- AU: [developer.webull.com.au](https://developer.webull.com.au/apis/home)
|
|
155
152
|
- MX: [developer.webull.com.mx](https://developer.webull.com.mx/apis/home)
|
|
156
153
|
- BR: [developer.webull.com.br](https://developer.webull.com.br/apis/home)
|
|
157
154
|
2. **API Credentials** — Obtain your `App Key` and `App Secret`
|
|
@@ -160,12 +157,9 @@ Here are some prompts you can use with your AI assistant:
|
|
|
160
157
|
- HK: [webullapp.hk/quote](https://www.webullapp.hk/quote) | [Guide](https://developer.webull.hk/apis/docs/market-data-api/subscribe-quotes)
|
|
161
158
|
- JP: [webull.co.jp/pricing](https://www.webull.co.jp/pricing) | [Guide](https://developer.webull.co.jp/api-doc/market-data/subscribe-quotes/)
|
|
162
159
|
- SG: [webull.com.sg/quote](https://www.webull.com.sg/quote) | [Guide](https://developer.webull.com.sg/apis/docs/market-data-api/subscribe-quotes)
|
|
163
|
-
- TH: [webull.co.th/quote](https://www.webull.co.th/quote) | [Guide](https://developer.webull.co.th/apis/docs/market-data-api/subscribe-quotes)
|
|
164
160
|
- MY: [webull.com.my/quote](https://www.webull.com.my/quote) | [Guide](https://developer.webull.com.my/apis/docs/market-data-api/subscribe-quotes)
|
|
165
161
|
- UK: [webull-uk.com/quote](https://www.webull-uk.com/quote) | [Guide](https://developer.webull-uk.com/apis/docs/market-data-api/subscribe-quotes)
|
|
166
|
-
- EU: [webullapp.eu/quote](https://www.webullapp.eu/quote) | [Guide](https://developer.webull.eu/apis/docs/market-data-api/subscribe-quotes)
|
|
167
162
|
- ZA: [webullapp.co.za/quote](https://www.webullapp.co.za/quote) | [Guide](https://developer.webull.co.za/apis/docs/market-data-api/subscribe-quotes)
|
|
168
|
-
- AU: [webullapp.com.au/quote](https://www.webullapp.com.au/quote) | [Guide](https://developer.webull.com.au/apis/docs/market-data-api/subscribe-quotes)
|
|
169
163
|
- MX: [webull.com.mx/quote](https://www.webull.com.mx/quote) | [Guide](https://developer.webull.com.mx/apis/docs/market-data-api/subscribe-quotes)
|
|
170
164
|
- BR: [webull.com.br/quote](https://www.webull.com.br/quote) | [Guide](https://developer.webull.com.br/apis/docs/market-data-api/subscribe-quotes)
|
|
171
165
|
4. **Python 3.10+**
|
|
@@ -310,7 +304,7 @@ Add to your MCP configuration:
|
|
|
310
304
|
| `WEBULL_APP_KEY` | App Key (required) | — |
|
|
311
305
|
| `WEBULL_APP_SECRET` | App Secret (required) | — |
|
|
312
306
|
| `WEBULL_ENVIRONMENT` | `uat` (sandbox) or `prod` | `uat` |
|
|
313
|
-
| `WEBULL_REGION_ID` | `us`, `hk`, `jp`, `sg`, `
|
|
307
|
+
| `WEBULL_REGION_ID` | `us`, `hk`, `jp`, `sg`, `my`, `uk`, `mx`, `br`, or `za` | `us` |
|
|
314
308
|
| `WEBULL_TOOLSETS` | Enabled tool categories (comma-separated). Valid values: `account`, `market-data`, `trading`, `instrument` | (all enabled) |
|
|
315
309
|
| `WEBULL_MAX_ORDER_NOTIONAL_USD` | Max order value for US market (USD) | `10000` |
|
|
316
310
|
| `WEBULL_MAX_ORDER_NOTIONAL_HKD` | Max order value for HK market (HKD) | `80000` |
|
|
@@ -322,7 +316,7 @@ Add to your MCP configuration:
|
|
|
322
316
|
| `WEBULL_AUDIT_LOG_FILE` | Audit log file path | stderr only |
|
|
323
317
|
| `WEBULL_LOG_LEVEL` | SDK log level | `WARNING` |
|
|
324
318
|
|
|
325
|
-
> **Note:** `WEBULL_REGION_ID=us` represents **Webull US** ([developer.webull.com](https://developer.webull.com/apis/home)), `WEBULL_REGION_ID=hk` represents **Webull Hong Kong** ([developer.webull.hk](https://developer.webull.hk/apis/home)), `WEBULL_REGION_ID=jp` represents **Webull Japan** ([developer.webull.co.jp](https://developer.webull.co.jp/)), `WEBULL_REGION_ID=sg` represents **Webull Singapore** ([developer.webull.com.sg](https://developer.webull.com.sg/apis/home)), `WEBULL_REGION_ID=
|
|
319
|
+
> **Note:** `WEBULL_REGION_ID=us` represents **Webull US** ([developer.webull.com](https://developer.webull.com/apis/home)), `WEBULL_REGION_ID=hk` represents **Webull Hong Kong** ([developer.webull.hk](https://developer.webull.hk/apis/home)), `WEBULL_REGION_ID=jp` represents **Webull Japan** ([developer.webull.co.jp](https://developer.webull.co.jp/)), `WEBULL_REGION_ID=sg` represents **Webull Singapore** ([developer.webull.com.sg](https://developer.webull.com.sg/apis/home)), `WEBULL_REGION_ID=my` represents **Webull Malaysia** ([developer.webull.com.my](https://developer.webull.com.my/apis/home)), `WEBULL_REGION_ID=uk` represents **Webull UK** ([developer.webull-uk.com](https://developer.webull-uk.com/apis/home)), `WEBULL_REGION_ID=mx` represents **Webull Mexico** ([developer.webull.com.mx](https://developer.webull.com.mx/apis/home)), `WEBULL_REGION_ID=br` represents **Webull Brazil** ([developer.webull.com.br](https://developer.webull.com.br/apis/home)), and `WEBULL_REGION_ID=za` represents **Webull South Africa** ([developer.webull.co.za](https://developer.webull.co.za/apis/home)).
|
|
326
320
|
|
|
327
321
|
See [.env.example](.env.example) for full configuration template.
|
|
328
322
|
|
|
@@ -370,28 +364,28 @@ See [.env.example](.env.example) for full configuration template.
|
|
|
370
364
|
|
|
371
365
|
### Region Differences
|
|
372
366
|
|
|
373
|
-
| Feature | US | HK | JP | SG |
|
|
374
|
-
|
|
375
|
-
| Stock Trading | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
376
|
-
| Option Trading | Yes | Yes | No | No | No | No | No | No | No |
|
|
377
|
-
| Futures Trading | Yes | Yes | No | No | No | No | No | No | No |
|
|
378
|
-
| Crypto Trading | Yes | No | No | No | No | No | No | No | No |
|
|
379
|
-
| Event Contracts | Yes | No | No | No | No | No | No | No | No |
|
|
380
|
-
| Combo Orders | Yes | No | No | No | No | No | No | No | No |
|
|
381
|
-
| Option Strategies | Yes | No | No | No | No | No | No | No | No |
|
|
382
|
-
| Algo Orders | Yes | No | No | No | No | No | No | No | No |
|
|
383
|
-
| Screener | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
384
|
-
| Watchlist | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
385
|
-
| Fundamental (Company/Analyst) | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
386
|
-
| Stock/Fund Fundamentals | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
387
|
-
| Financial Statements | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
388
|
-
| NOII (Auction Imbalance) | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
389
|
-
| Markets | US | US, HK, CN | US, JP | US | US | US | US | US | US |
|
|
390
|
-
| Instrument Categories | US_STOCK, US_ETF | US_STOCK, US_ETF, HK_STOCK, CN_STOCK | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF |
|
|
391
|
-
| Order Types | LIMIT, MARKET, STOP_LOSS, STOP_LOSS_LIMIT, TRAILING_STOP_LOSS, etc. | LIMIT, MARKET, ENHANCED_LIMIT, AT_AUCTION, AT_AUCTION_LIMIT, etc. | JP market: LIMIT, MARKET — US market: LIMIT, MARKET, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT |
|
|
392
|
-
| Time-in-Force | DAY, GTC | US market: DAY, GTC, GTD — HK market: DAY, GTC — CN market: DAY | JP market: DAY — US market: DAY, GTC, GTD | DAY, GTC | DAY, GTC | DAY, GTC | DAY, GTC | DAY, GTC | DAY, GTC |
|
|
393
|
-
| Trading Sessions | ALL, CORE, NIGHT | CORE, ALL_DAY, NIGHT, ALL | CORE, ALL, NIGHT, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY |
|
|
394
|
-
| JP Order Fields | — | — | `account_tax_type` required (GENERAL or SPECIFIC); `margin_type` (ONE_DAY or INDEFINITE) and `position_intent` optional margin-account-only fields; `close_contracts` optional | — | — | — | — | — | — |
|
|
367
|
+
| Feature | US | HK | JP | SG | MY | UK | MX | BR | ZA |
|
|
368
|
+
|-----------------------------|----|----|----|----|----|-----|----|----|----|
|
|
369
|
+
| Stock Trading | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
370
|
+
| Option Trading | Yes | Yes | No | No | No | No | No | No | No |
|
|
371
|
+
| Futures Trading | Yes | Yes | No | No | No | No | No | No | No |
|
|
372
|
+
| Crypto Trading | Yes | No | No | No | No | No | No | No | No |
|
|
373
|
+
| Event Contracts | Yes | No | No | No | No | No | No | No | No |
|
|
374
|
+
| Combo Orders | Yes | No | No | No | No | No | No | No | No |
|
|
375
|
+
| Option Strategies | Yes | No | No | No | No | No | No | No | No |
|
|
376
|
+
| Algo Orders | Yes | No | No | No | No | No | No | No | No |
|
|
377
|
+
| Screener | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
378
|
+
| Watchlist | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
379
|
+
| Fundamental (Company/Analyst) | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
380
|
+
| Stock/Fund Fundamentals | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
381
|
+
| Financial Statements | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
382
|
+
| NOII (Auction Imbalance) | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
383
|
+
| Markets | US | US, HK, CN | US, JP | US | US | US | US | US | US |
|
|
384
|
+
| Instrument Categories | US_STOCK, US_ETF | US_STOCK, US_ETF, HK_STOCK, CN_STOCK | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF |
|
|
385
|
+
| Order Types | LIMIT, MARKET, STOP_LOSS, STOP_LOSS_LIMIT, TRAILING_STOP_LOSS, etc. | LIMIT, MARKET, ENHANCED_LIMIT, AT_AUCTION, AT_AUCTION_LIMIT, etc. | JP market: LIMIT, MARKET — US market: LIMIT, MARKET, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT |
|
|
386
|
+
| Time-in-Force | DAY, GTC | US market: DAY, GTC, GTD — HK market: DAY, GTC — CN market: DAY | JP market: DAY — US market: DAY, GTC, GTD | DAY, GTC | DAY, GTC | DAY, GTC | DAY, GTC | DAY, GTC | DAY, GTC |
|
|
387
|
+
| Trading Sessions | ALL, CORE, NIGHT | CORE, ALL_DAY, NIGHT, ALL | CORE, ALL, NIGHT, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY |
|
|
388
|
+
| JP Order Fields | — | — | `account_tax_type` required (GENERAL or SPECIFIC); `margin_type` (ONE_DAY or INDEFINITE) and `position_intent` optional margin-account-only fields; `close_contracts` optional | — | — | — | — | — | — |
|
|
395
389
|
|
|
396
390
|
> **Note:** Screener (Gainers/Losers/Active), Fundamental (Company/Analyst), and NOII currently only support querying US stock data (`US_STOCK` category). Stock/Fund Fundamentals, Financial Statements, and the extended Screener (Sectors/Dividend/52W) are available in all regions; supported `category` values vary by endpoint (commonly `US_STOCK`, `HK_STOCK`, `CN_STOCK`, `JP_STOCK`). Watchlist supports US stocks and HK stocks.
|
|
397
391
|
|
|
@@ -438,7 +432,7 @@ All commands accept `--env-file PATH` to specify a custom `.env` file location (
|
|
|
438
432
|
- **Review before trading** — Always review order details proposed by the AI before confirming. Use `preview_stock_order` / `preview_option_order` before placing orders.
|
|
439
433
|
- **Use toolset filtering** — Set `WEBULL_TOOLSETS=account,market-data` to disable trading tools entirely if you only need read-only access. Valid toolsets: `account`, `market-data`, `trading`, `instrument`.
|
|
440
434
|
- **Default sandbox** — The server defaults to UAT (sandbox) environment. You must explicitly set `WEBULL_ENVIRONMENT=prod` for live trading.
|
|
441
|
-
- **Dependency security** — `fastmcp` is pinned to version `3.0.2` and `webull-openapi-python-sdk` is pinned to `
|
|
435
|
+
- **Dependency security** — `fastmcp` is pinned to version `3.0.2` and `webull-openapi-python-sdk` is pinned to `3.0.0`. Users are responsible for monitoring and updating third-party dependencies for security patches. Review release notes before upgrading.
|
|
442
436
|
|
|
443
437
|
---
|
|
444
438
|
|
|
@@ -479,12 +473,9 @@ Subscribe to quotes:
|
|
|
479
473
|
- HK: [webullapp.hk/quote](https://www.webullapp.hk/quote) | [Guide](https://developer.webull.hk/apis/docs/market-data-api/subscribe-quotes)
|
|
480
474
|
- JP: [webull.co.jp/pricing](https://www.webull.co.jp/pricing) | [Guide](https://developer.webull.co.jp/api-doc/market-data/subscribe-quotes/)
|
|
481
475
|
- SG: [webull.com.sg/quote](https://www.webull.com.sg/quote) | [Guide](https://developer.webull.com.sg/apis/docs/market-data-api/subscribe-quotes)
|
|
482
|
-
- TH: [webull.co.th/quote](https://www.webull.co.th/quote) | [Guide](https://developer.webull.co.th/apis/docs/market-data-api/subscribe-quotes)
|
|
483
476
|
- MY: [webull.com.my/quote](https://www.webull.com.my/quote) | [Guide](https://developer.webull.com.my/apis/docs/market-data-api/subscribe-quotes)
|
|
484
477
|
- UK: [webull-uk.com/quote](https://www.webull-uk.com/quote) | [Guide](https://developer.webull-uk.com/apis/docs/market-data-api/subscribe-quotes)
|
|
485
|
-
- EU: [webullapp.eu/quote](https://www.webullapp.eu/quote) | [Guide](https://developer.webull.eu/apis/docs/market-data-api/subscribe-quotes)
|
|
486
478
|
- ZA: [webullapp.co.za/quote](https://www.webullapp.co.za/quote) | [Guide](https://developer.webull.co.za/apis/docs/market-data-api/subscribe-quotes)
|
|
487
|
-
- AU: [webullapp.com.au/quote](https://www.webullapp.com.au/quote) | [Guide](https://developer.webull.com.au/apis/docs/market-data-api/subscribe-quotes)
|
|
488
479
|
- MX: [webull.com.mx/quote](https://www.webull.com.mx/quote) | [Guide](https://developer.webull.com.mx/apis/docs/market-data-api/subscribe-quotes)
|
|
489
480
|
- BR: [webull.com.br/quote](https://www.webull.com.br/quote) | [Guide](https://developer.webull.com.br/apis/docs/market-data-api/subscribe-quotes)
|
|
490
481
|
|
|
@@ -521,7 +512,7 @@ webull-openapi-mcp/
|
|
|
521
512
|
│ ├── server.py # MCP server setup and tool registration
|
|
522
513
|
│ ├── sdk_client.py # Webull SDK adapter (ApiClient, TradeClient, DataClient)
|
|
523
514
|
│ ├── config.py # Configuration loading and validation
|
|
524
|
-
│ ├── region_config.py # Region-specific settings (US, HK, JP, SG,
|
|
515
|
+
│ ├── region_config.py # Region-specific settings (US, HK, JP, SG, MY, UK, MX, BR, ZA)
|
|
525
516
|
│ ├── guards.py # Order validation (price, quantity, notional, region rules)
|
|
526
517
|
│ ├── audit.py # Audit logging for order operations
|
|
527
518
|
│ ├── errors.py # Exception definitions and SDK error handling
|
|
@@ -19,7 +19,7 @@ See [DISCLAIMER.md](DISCLAIMER.md) for the full disclaimer.
|
|
|
19
19
|
|
|
20
20
|
## Features
|
|
21
21
|
|
|
22
|
-
- **Multi-Region Support** — US, HK, JP, SG,
|
|
22
|
+
- **Multi-Region Support** — US, HK, JP, SG, MY, UK, MX, BR, and ZA regions with region-specific order types, trading sessions, and validation
|
|
23
23
|
- **Market Data** — Real-time snapshots, tick data, quotes (depth), footprint, and OHLCV bars for stocks, options, futures, crypto, and event contracts
|
|
24
24
|
- **NOII Data** — Net Order Imbalance Indicator bars and snapshots for US stock opening/closing auctions
|
|
25
25
|
- **Screener** — Top gainers/losers, most active, market sectors, high dividend, and 52-week high/low rankings
|
|
@@ -116,12 +116,9 @@ Here are some prompts you can use with your AI assistant:
|
|
|
116
116
|
- HK: [developer.webull.hk](https://developer.webull.hk/apis/home)
|
|
117
117
|
- JP: [developer.webull.co.jp](https://developer.webull.co.jp/)
|
|
118
118
|
- SG: [developer.webull.com.sg](https://developer.webull.com.sg/apis/home)
|
|
119
|
-
- TH: [developer.webull.co.th](https://developer.webull.co.th/apis/home)
|
|
120
119
|
- MY: [developer.webull.com.my](https://developer.webull.com.my/apis/home)
|
|
121
120
|
- UK: [developer.webull-uk.com](https://developer.webull-uk.com/apis/home)
|
|
122
|
-
- EU: [developer.webull.eu](https://developer.webull.eu/apis/home)
|
|
123
121
|
- ZA: [developer.webull.co.za](https://developer.webull.co.za/apis/home)
|
|
124
|
-
- AU: [developer.webull.com.au](https://developer.webull.com.au/apis/home)
|
|
125
122
|
- MX: [developer.webull.com.mx](https://developer.webull.com.mx/apis/home)
|
|
126
123
|
- BR: [developer.webull.com.br](https://developer.webull.com.br/apis/home)
|
|
127
124
|
2. **API Credentials** — Obtain your `App Key` and `App Secret`
|
|
@@ -130,12 +127,9 @@ Here are some prompts you can use with your AI assistant:
|
|
|
130
127
|
- HK: [webullapp.hk/quote](https://www.webullapp.hk/quote) | [Guide](https://developer.webull.hk/apis/docs/market-data-api/subscribe-quotes)
|
|
131
128
|
- JP: [webull.co.jp/pricing](https://www.webull.co.jp/pricing) | [Guide](https://developer.webull.co.jp/api-doc/market-data/subscribe-quotes/)
|
|
132
129
|
- SG: [webull.com.sg/quote](https://www.webull.com.sg/quote) | [Guide](https://developer.webull.com.sg/apis/docs/market-data-api/subscribe-quotes)
|
|
133
|
-
- TH: [webull.co.th/quote](https://www.webull.co.th/quote) | [Guide](https://developer.webull.co.th/apis/docs/market-data-api/subscribe-quotes)
|
|
134
130
|
- MY: [webull.com.my/quote](https://www.webull.com.my/quote) | [Guide](https://developer.webull.com.my/apis/docs/market-data-api/subscribe-quotes)
|
|
135
131
|
- UK: [webull-uk.com/quote](https://www.webull-uk.com/quote) | [Guide](https://developer.webull-uk.com/apis/docs/market-data-api/subscribe-quotes)
|
|
136
|
-
- EU: [webullapp.eu/quote](https://www.webullapp.eu/quote) | [Guide](https://developer.webull.eu/apis/docs/market-data-api/subscribe-quotes)
|
|
137
132
|
- ZA: [webullapp.co.za/quote](https://www.webullapp.co.za/quote) | [Guide](https://developer.webull.co.za/apis/docs/market-data-api/subscribe-quotes)
|
|
138
|
-
- AU: [webullapp.com.au/quote](https://www.webullapp.com.au/quote) | [Guide](https://developer.webull.com.au/apis/docs/market-data-api/subscribe-quotes)
|
|
139
133
|
- MX: [webull.com.mx/quote](https://www.webull.com.mx/quote) | [Guide](https://developer.webull.com.mx/apis/docs/market-data-api/subscribe-quotes)
|
|
140
134
|
- BR: [webull.com.br/quote](https://www.webull.com.br/quote) | [Guide](https://developer.webull.com.br/apis/docs/market-data-api/subscribe-quotes)
|
|
141
135
|
4. **Python 3.10+**
|
|
@@ -280,7 +274,7 @@ Add to your MCP configuration:
|
|
|
280
274
|
| `WEBULL_APP_KEY` | App Key (required) | — |
|
|
281
275
|
| `WEBULL_APP_SECRET` | App Secret (required) | — |
|
|
282
276
|
| `WEBULL_ENVIRONMENT` | `uat` (sandbox) or `prod` | `uat` |
|
|
283
|
-
| `WEBULL_REGION_ID` | `us`, `hk`, `jp`, `sg`, `
|
|
277
|
+
| `WEBULL_REGION_ID` | `us`, `hk`, `jp`, `sg`, `my`, `uk`, `mx`, `br`, or `za` | `us` |
|
|
284
278
|
| `WEBULL_TOOLSETS` | Enabled tool categories (comma-separated). Valid values: `account`, `market-data`, `trading`, `instrument` | (all enabled) |
|
|
285
279
|
| `WEBULL_MAX_ORDER_NOTIONAL_USD` | Max order value for US market (USD) | `10000` |
|
|
286
280
|
| `WEBULL_MAX_ORDER_NOTIONAL_HKD` | Max order value for HK market (HKD) | `80000` |
|
|
@@ -292,7 +286,7 @@ Add to your MCP configuration:
|
|
|
292
286
|
| `WEBULL_AUDIT_LOG_FILE` | Audit log file path | stderr only |
|
|
293
287
|
| `WEBULL_LOG_LEVEL` | SDK log level | `WARNING` |
|
|
294
288
|
|
|
295
|
-
> **Note:** `WEBULL_REGION_ID=us` represents **Webull US** ([developer.webull.com](https://developer.webull.com/apis/home)), `WEBULL_REGION_ID=hk` represents **Webull Hong Kong** ([developer.webull.hk](https://developer.webull.hk/apis/home)), `WEBULL_REGION_ID=jp` represents **Webull Japan** ([developer.webull.co.jp](https://developer.webull.co.jp/)), `WEBULL_REGION_ID=sg` represents **Webull Singapore** ([developer.webull.com.sg](https://developer.webull.com.sg/apis/home)), `WEBULL_REGION_ID=
|
|
289
|
+
> **Note:** `WEBULL_REGION_ID=us` represents **Webull US** ([developer.webull.com](https://developer.webull.com/apis/home)), `WEBULL_REGION_ID=hk` represents **Webull Hong Kong** ([developer.webull.hk](https://developer.webull.hk/apis/home)), `WEBULL_REGION_ID=jp` represents **Webull Japan** ([developer.webull.co.jp](https://developer.webull.co.jp/)), `WEBULL_REGION_ID=sg` represents **Webull Singapore** ([developer.webull.com.sg](https://developer.webull.com.sg/apis/home)), `WEBULL_REGION_ID=my` represents **Webull Malaysia** ([developer.webull.com.my](https://developer.webull.com.my/apis/home)), `WEBULL_REGION_ID=uk` represents **Webull UK** ([developer.webull-uk.com](https://developer.webull-uk.com/apis/home)), `WEBULL_REGION_ID=mx` represents **Webull Mexico** ([developer.webull.com.mx](https://developer.webull.com.mx/apis/home)), `WEBULL_REGION_ID=br` represents **Webull Brazil** ([developer.webull.com.br](https://developer.webull.com.br/apis/home)), and `WEBULL_REGION_ID=za` represents **Webull South Africa** ([developer.webull.co.za](https://developer.webull.co.za/apis/home)).
|
|
296
290
|
|
|
297
291
|
See [.env.example](.env.example) for full configuration template.
|
|
298
292
|
|
|
@@ -340,28 +334,28 @@ See [.env.example](.env.example) for full configuration template.
|
|
|
340
334
|
|
|
341
335
|
### Region Differences
|
|
342
336
|
|
|
343
|
-
| Feature | US | HK | JP | SG |
|
|
344
|
-
|
|
345
|
-
| Stock Trading | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
346
|
-
| Option Trading | Yes | Yes | No | No | No | No | No | No | No |
|
|
347
|
-
| Futures Trading | Yes | Yes | No | No | No | No | No | No | No |
|
|
348
|
-
| Crypto Trading | Yes | No | No | No | No | No | No | No | No |
|
|
349
|
-
| Event Contracts | Yes | No | No | No | No | No | No | No | No |
|
|
350
|
-
| Combo Orders | Yes | No | No | No | No | No | No | No | No |
|
|
351
|
-
| Option Strategies | Yes | No | No | No | No | No | No | No | No |
|
|
352
|
-
| Algo Orders | Yes | No | No | No | No | No | No | No | No |
|
|
353
|
-
| Screener | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
354
|
-
| Watchlist | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
355
|
-
| Fundamental (Company/Analyst) | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
356
|
-
| Stock/Fund Fundamentals | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
357
|
-
| Financial Statements | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
358
|
-
| NOII (Auction Imbalance) | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
359
|
-
| Markets | US | US, HK, CN | US, JP | US | US | US | US | US | US |
|
|
360
|
-
| Instrument Categories | US_STOCK, US_ETF | US_STOCK, US_ETF, HK_STOCK, CN_STOCK | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF |
|
|
361
|
-
| Order Types | LIMIT, MARKET, STOP_LOSS, STOP_LOSS_LIMIT, TRAILING_STOP_LOSS, etc. | LIMIT, MARKET, ENHANCED_LIMIT, AT_AUCTION, AT_AUCTION_LIMIT, etc. | JP market: LIMIT, MARKET — US market: LIMIT, MARKET, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT |
|
|
362
|
-
| Time-in-Force | DAY, GTC | US market: DAY, GTC, GTD — HK market: DAY, GTC — CN market: DAY | JP market: DAY — US market: DAY, GTC, GTD | DAY, GTC | DAY, GTC | DAY, GTC | DAY, GTC | DAY, GTC | DAY, GTC |
|
|
363
|
-
| Trading Sessions | ALL, CORE, NIGHT | CORE, ALL_DAY, NIGHT, ALL | CORE, ALL, NIGHT, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY |
|
|
364
|
-
| JP Order Fields | — | — | `account_tax_type` required (GENERAL or SPECIFIC); `margin_type` (ONE_DAY or INDEFINITE) and `position_intent` optional margin-account-only fields; `close_contracts` optional | — | — | — | — | — | — |
|
|
337
|
+
| Feature | US | HK | JP | SG | MY | UK | MX | BR | ZA |
|
|
338
|
+
|-----------------------------|----|----|----|----|----|-----|----|----|----|
|
|
339
|
+
| Stock Trading | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
340
|
+
| Option Trading | Yes | Yes | No | No | No | No | No | No | No |
|
|
341
|
+
| Futures Trading | Yes | Yes | No | No | No | No | No | No | No |
|
|
342
|
+
| Crypto Trading | Yes | No | No | No | No | No | No | No | No |
|
|
343
|
+
| Event Contracts | Yes | No | No | No | No | No | No | No | No |
|
|
344
|
+
| Combo Orders | Yes | No | No | No | No | No | No | No | No |
|
|
345
|
+
| Option Strategies | Yes | No | No | No | No | No | No | No | No |
|
|
346
|
+
| Algo Orders | Yes | No | No | No | No | No | No | No | No |
|
|
347
|
+
| Screener | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
348
|
+
| Watchlist | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
349
|
+
| Fundamental (Company/Analyst) | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
350
|
+
| Stock/Fund Fundamentals | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
351
|
+
| Financial Statements | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
352
|
+
| NOII (Auction Imbalance) | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
353
|
+
| Markets | US | US, HK, CN | US, JP | US | US | US | US | US | US |
|
|
354
|
+
| Instrument Categories | US_STOCK, US_ETF | US_STOCK, US_ETF, HK_STOCK, CN_STOCK | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF | US_STOCK, US_ETF |
|
|
355
|
+
| Order Types | LIMIT, MARKET, STOP_LOSS, STOP_LOSS_LIMIT, TRAILING_STOP_LOSS, etc. | LIMIT, MARKET, ENHANCED_LIMIT, AT_AUCTION, AT_AUCTION_LIMIT, etc. | JP market: LIMIT, MARKET — US market: LIMIT, MARKET, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT | MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT |
|
|
356
|
+
| Time-in-Force | DAY, GTC | US market: DAY, GTC, GTD — HK market: DAY, GTC — CN market: DAY | JP market: DAY — US market: DAY, GTC, GTD | DAY, GTC | DAY, GTC | DAY, GTC | DAY, GTC | DAY, GTC | DAY, GTC |
|
|
357
|
+
| Trading Sessions | ALL, CORE, NIGHT | CORE, ALL_DAY, NIGHT, ALL | CORE, ALL, NIGHT, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY | NIGHT, ALL, CORE, ALL_DAY |
|
|
358
|
+
| JP Order Fields | — | — | `account_tax_type` required (GENERAL or SPECIFIC); `margin_type` (ONE_DAY or INDEFINITE) and `position_intent` optional margin-account-only fields; `close_contracts` optional | — | — | — | — | — | — |
|
|
365
359
|
|
|
366
360
|
> **Note:** Screener (Gainers/Losers/Active), Fundamental (Company/Analyst), and NOII currently only support querying US stock data (`US_STOCK` category). Stock/Fund Fundamentals, Financial Statements, and the extended Screener (Sectors/Dividend/52W) are available in all regions; supported `category` values vary by endpoint (commonly `US_STOCK`, `HK_STOCK`, `CN_STOCK`, `JP_STOCK`). Watchlist supports US stocks and HK stocks.
|
|
367
361
|
|
|
@@ -408,7 +402,7 @@ All commands accept `--env-file PATH` to specify a custom `.env` file location (
|
|
|
408
402
|
- **Review before trading** — Always review order details proposed by the AI before confirming. Use `preview_stock_order` / `preview_option_order` before placing orders.
|
|
409
403
|
- **Use toolset filtering** — Set `WEBULL_TOOLSETS=account,market-data` to disable trading tools entirely if you only need read-only access. Valid toolsets: `account`, `market-data`, `trading`, `instrument`.
|
|
410
404
|
- **Default sandbox** — The server defaults to UAT (sandbox) environment. You must explicitly set `WEBULL_ENVIRONMENT=prod` for live trading.
|
|
411
|
-
- **Dependency security** — `fastmcp` is pinned to version `3.0.2` and `webull-openapi-python-sdk` is pinned to `
|
|
405
|
+
- **Dependency security** — `fastmcp` is pinned to version `3.0.2` and `webull-openapi-python-sdk` is pinned to `3.0.0`. Users are responsible for monitoring and updating third-party dependencies for security patches. Review release notes before upgrading.
|
|
412
406
|
|
|
413
407
|
---
|
|
414
408
|
|
|
@@ -449,12 +443,9 @@ Subscribe to quotes:
|
|
|
449
443
|
- HK: [webullapp.hk/quote](https://www.webullapp.hk/quote) | [Guide](https://developer.webull.hk/apis/docs/market-data-api/subscribe-quotes)
|
|
450
444
|
- JP: [webull.co.jp/pricing](https://www.webull.co.jp/pricing) | [Guide](https://developer.webull.co.jp/api-doc/market-data/subscribe-quotes/)
|
|
451
445
|
- SG: [webull.com.sg/quote](https://www.webull.com.sg/quote) | [Guide](https://developer.webull.com.sg/apis/docs/market-data-api/subscribe-quotes)
|
|
452
|
-
- TH: [webull.co.th/quote](https://www.webull.co.th/quote) | [Guide](https://developer.webull.co.th/apis/docs/market-data-api/subscribe-quotes)
|
|
453
446
|
- MY: [webull.com.my/quote](https://www.webull.com.my/quote) | [Guide](https://developer.webull.com.my/apis/docs/market-data-api/subscribe-quotes)
|
|
454
447
|
- UK: [webull-uk.com/quote](https://www.webull-uk.com/quote) | [Guide](https://developer.webull-uk.com/apis/docs/market-data-api/subscribe-quotes)
|
|
455
|
-
- EU: [webullapp.eu/quote](https://www.webullapp.eu/quote) | [Guide](https://developer.webull.eu/apis/docs/market-data-api/subscribe-quotes)
|
|
456
448
|
- ZA: [webullapp.co.za/quote](https://www.webullapp.co.za/quote) | [Guide](https://developer.webull.co.za/apis/docs/market-data-api/subscribe-quotes)
|
|
457
|
-
- AU: [webullapp.com.au/quote](https://www.webullapp.com.au/quote) | [Guide](https://developer.webull.com.au/apis/docs/market-data-api/subscribe-quotes)
|
|
458
449
|
- MX: [webull.com.mx/quote](https://www.webull.com.mx/quote) | [Guide](https://developer.webull.com.mx/apis/docs/market-data-api/subscribe-quotes)
|
|
459
450
|
- BR: [webull.com.br/quote](https://www.webull.com.br/quote) | [Guide](https://developer.webull.com.br/apis/docs/market-data-api/subscribe-quotes)
|
|
460
451
|
|
|
@@ -491,7 +482,7 @@ webull-openapi-mcp/
|
|
|
491
482
|
│ ├── server.py # MCP server setup and tool registration
|
|
492
483
|
│ ├── sdk_client.py # Webull SDK adapter (ApiClient, TradeClient, DataClient)
|
|
493
484
|
│ ├── config.py # Configuration loading and validation
|
|
494
|
-
│ ├── region_config.py # Region-specific settings (US, HK, JP, SG,
|
|
485
|
+
│ ├── region_config.py # Region-specific settings (US, HK, JP, SG, MY, UK, MX, BR, ZA)
|
|
495
486
|
│ ├── guards.py # Order validation (price, quantity, notional, region rules)
|
|
496
487
|
│ ├── audit.py # Audit logging for order operations
|
|
497
488
|
│ ├── errors.py # Exception definitions and SDK error handling
|
|
@@ -194,7 +194,7 @@ def build_manifest(
|
|
|
194
194
|
"region_id": {
|
|
195
195
|
"type": "string",
|
|
196
196
|
"title": "Region",
|
|
197
|
-
"description": "Webull region: us, hk, jp, sg,
|
|
197
|
+
"description": "Webull region: us, hk, jp, sg, my, uk, mx, br, or za.",
|
|
198
198
|
"default": "us",
|
|
199
199
|
"required": True,
|
|
200
200
|
},
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "webull-openapi-mcp"
|
|
7
|
-
version = "1.2.
|
|
7
|
+
version = "1.2.4"
|
|
8
8
|
description = "MCP Server for Webull OpenAPI - enables AI assistants to securely access Webull trading and market data"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "Apache-2.0"
|
|
@@ -24,7 +24,7 @@ dependencies = [
|
|
|
24
24
|
"fastmcp==3.0.2",
|
|
25
25
|
"click",
|
|
26
26
|
"python-dotenv",
|
|
27
|
-
"webull-openapi-python-sdk==
|
|
27
|
+
"webull-openapi-python-sdk==3.0.0",
|
|
28
28
|
]
|
|
29
29
|
|
|
30
30
|
[project.urls]
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "io.github.webull-inc/webull-openapi-mcp",
|
|
4
4
|
"title": "Webull OpenAPI",
|
|
5
5
|
"description": "MCP server for Webull OpenAPI: trading and market data access for AI assistants",
|
|
6
|
-
"version": "1.2.
|
|
6
|
+
"version": "1.2.4",
|
|
7
7
|
"repository": {
|
|
8
8
|
"url": "https://github.com/webull-inc/webull-openapi-mcp",
|
|
9
9
|
"source": "github"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"registryType": "pypi",
|
|
14
14
|
"registryBaseUrl": "https://pypi.org",
|
|
15
15
|
"identifier": "webull-openapi-mcp",
|
|
16
|
-
"version": "1.2.
|
|
16
|
+
"version": "1.2.4",
|
|
17
17
|
"runtimeHint": "uvx",
|
|
18
18
|
"transport": {
|
|
19
19
|
"type": "stdio"
|
|
@@ -199,14 +199,14 @@ def test_new_tools_registered_for_supported_regions(region):
|
|
|
199
199
|
assert not missing, f"{region} missing: {missing}"
|
|
200
200
|
|
|
201
201
|
|
|
202
|
-
@pytest.mark.parametrize("region", ["sg", "
|
|
202
|
+
@pytest.mark.parametrize("region", ["sg", "my", "uk", "mx", "br"])
|
|
203
203
|
def test_new_tools_absent_for_unsupported_regions(region):
|
|
204
204
|
names = _build_server_tools(region)
|
|
205
205
|
present = [t for t in EXPECTED_TOOLS if t in names]
|
|
206
|
-
assert
|
|
206
|
+
assert present, f"{region} should not expose: {present}"
|
|
207
207
|
|
|
208
208
|
|
|
209
|
-
@pytest.mark.parametrize("region", ["us", "hk", "jp", "sg", "
|
|
209
|
+
@pytest.mark.parametrize("region", ["us", "hk", "jp", "sg", "my", "uk", "mx", "br"])
|
|
210
210
|
def test_legacy_tools_available_in_all_regions(region):
|
|
211
211
|
names = _build_server_tools(region)
|
|
212
212
|
missing = [t for t in LEGACY_TOOLS if t not in names]
|
|
@@ -27,10 +27,10 @@ class TestUATEndpoints:
|
|
|
27
27
|
assert UAT_ENDPOINTS["default_region"] == "us"
|
|
28
28
|
|
|
29
29
|
def test_regions_list(self):
|
|
30
|
-
assert set(UAT_ENDPOINTS["regions"]) == {"us", "hk", "jp", "sg", "
|
|
30
|
+
assert set(UAT_ENDPOINTS["regions"]) == {"us", "hk", "jp", "sg", "my", "uk", "mx", "br", "za"}
|
|
31
31
|
|
|
32
32
|
def test_each_region_has_all_api_types(self):
|
|
33
|
-
for region in ("us", "hk", "jp", "sg", "
|
|
33
|
+
for region in ("us", "hk", "jp", "sg", "my", "uk", "mx", "br", "za"):
|
|
34
34
|
mapping = UAT_ENDPOINTS["region_mapping"][region]
|
|
35
35
|
assert "api" in mapping
|
|
36
36
|
assert "quotes-api" in mapping
|
|
@@ -152,7 +152,7 @@ WEBULL_APP_SECRET={app_secret}
|
|
|
152
152
|
# API environment: uat or prod (default: uat)
|
|
153
153
|
WEBULL_ENVIRONMENT={environment}
|
|
154
154
|
|
|
155
|
-
# Optional: Region ID (default: us). Supported: us, hk, jp, sg,
|
|
155
|
+
# Optional: Region ID (default: us). Supported: us, hk, jp, sg, my, uk, mx, br, za
|
|
156
156
|
# WEBULL_REGION_ID=us
|
|
157
157
|
|
|
158
158
|
# Optional: Risk control parameters
|
|
@@ -55,13 +55,6 @@ _DISCLAIMER_SG = (
|
|
|
55
55
|
"Trading involves risk; please make decisions carefully.\n\n"
|
|
56
56
|
)
|
|
57
57
|
|
|
58
|
-
_DISCLAIMER_TH = (
|
|
59
|
-
"⚠️ Disclaimer: "
|
|
60
|
-
"The information provided by this tool is for reference only "
|
|
61
|
-
"and does not constitute investment advice. "
|
|
62
|
-
"Trading involves risk; please make decisions carefully.\n\n"
|
|
63
|
-
)
|
|
64
|
-
|
|
65
58
|
_DISCLAIMER_MY = (
|
|
66
59
|
"⚠️ Disclaimer: "
|
|
67
60
|
"The information provided by this tool is for reference only "
|
|
@@ -93,8 +86,6 @@ def set_disclaimer_region(region_id: str) -> None:
|
|
|
93
86
|
DISCLAIMER = _DISCLAIMER_JP
|
|
94
87
|
elif _current_region == "sg":
|
|
95
88
|
DISCLAIMER = _DISCLAIMER_SG
|
|
96
|
-
elif _current_region == "th":
|
|
97
|
-
DISCLAIMER = _DISCLAIMER_TH
|
|
98
89
|
elif _current_region == "my":
|
|
99
90
|
DISCLAIMER = _DISCLAIMER_MY
|
|
100
91
|
elif _current_region == "uk":
|
|
@@ -824,6 +815,62 @@ def format_order_detail(data: dict | None) -> str:
|
|
|
824
815
|
return "\n".join(lines)
|
|
825
816
|
|
|
826
817
|
|
|
818
|
+
def _format_execution_item(item: dict) -> list[str]:
|
|
819
|
+
"""Format a single execution record."""
|
|
820
|
+
return [
|
|
821
|
+
f" Execution ID: {_get(item, 'execution_id')}",
|
|
822
|
+
f" Order ID: {_get(item, 'order_id')}",
|
|
823
|
+
f" Client Order ID: {_get(item, 'client_order_id')}",
|
|
824
|
+
f" Symbol: {_get(item, 'symbol')}",
|
|
825
|
+
f" Execution Time: {_get(item, 'execution_time')}",
|
|
826
|
+
f" Status: {_get(item, 'status')}",
|
|
827
|
+
f" Execution Type: {_get(item, 'execution_type')}",
|
|
828
|
+
f" Side: {_get(item, 'side')}",
|
|
829
|
+
f" Order Type: {_get(item, 'order_type')}",
|
|
830
|
+
f" Total Quantity: {_get(item, 'total_quantity')}",
|
|
831
|
+
f" Limit Price: {_get(item, 'limit_price')}",
|
|
832
|
+
f" Filled Quantity: {_get(item, 'filled_quantity')}",
|
|
833
|
+
f" Filled Price: {_get(item, 'filled_price')}",
|
|
834
|
+
f" Total Filled Qty: {_get(item, 'total_filled_qty')}",
|
|
835
|
+
f" Leaves Qty: {_get(item, 'leaves_qty')}",
|
|
836
|
+
]
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
def format_order_executions(data: Any) -> str:
|
|
840
|
+
"""Format order executions response.
|
|
841
|
+
|
|
842
|
+
API returns execution records under a ``data`` list, plus a top-level
|
|
843
|
+
``pagination_key`` cursor for fetching the next page:
|
|
844
|
+
{"data": [{execution_id, order_id, client_order_id, symbol,
|
|
845
|
+
execution_time, status, execution_type, side, order_type,
|
|
846
|
+
total_quantity, limit_price, filled_quantity, filled_price,
|
|
847
|
+
total_filled_qty, leaves_qty}],
|
|
848
|
+
"pagination_key": "..."}
|
|
849
|
+
"""
|
|
850
|
+
if not data:
|
|
851
|
+
return _NO_DATA
|
|
852
|
+
|
|
853
|
+
executions = data.get("data", []) if isinstance(data, dict) else data
|
|
854
|
+
if not executions or not isinstance(executions, list):
|
|
855
|
+
return _NO_DATA
|
|
856
|
+
|
|
857
|
+
lines: list[str] = ["=== Order Executions ==="]
|
|
858
|
+
for i, item in enumerate(executions, 1):
|
|
859
|
+
if not isinstance(item, dict):
|
|
860
|
+
continue
|
|
861
|
+
lines.append(f"\n[Execution {i}]")
|
|
862
|
+
lines.extend(_format_execution_item(item))
|
|
863
|
+
|
|
864
|
+
# Top-level pagination cursor. Pass this value back as pagination_key to
|
|
865
|
+
# fetch the next page. Present only when more records are available.
|
|
866
|
+
if isinstance(data, dict):
|
|
867
|
+
pagination_key = data.get("pagination_key") or data.get("next_pagination_key")
|
|
868
|
+
if pagination_key:
|
|
869
|
+
lines.append(f"\nNext pagination_key: {pagination_key}")
|
|
870
|
+
|
|
871
|
+
return "\n".join(lines)
|
|
872
|
+
|
|
873
|
+
|
|
827
874
|
# ---------------------------------------------------------------------------
|
|
828
875
|
# Instrument formatters
|
|
829
876
|
# ---------------------------------------------------------------------------
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Region-specific configuration for Webull MCP Server.
|
|
2
2
|
|
|
3
|
-
Defines region configurations for US, HK, JP, SG,
|
|
3
|
+
Defines region configurations for US, HK, JP, SG, MY, UK, MX, BR, and ZA markets with:
|
|
4
4
|
- Feature flags (futures, crypto, event contracts, etc.)
|
|
5
5
|
- Valid enum sets for order types, time-in-force, trading sessions, etc.
|
|
6
6
|
|
|
@@ -195,35 +195,6 @@ SG_REGION_CONFIG = RegionConfig(
|
|
|
195
195
|
)
|
|
196
196
|
|
|
197
197
|
|
|
198
|
-
# =============================================================================
|
|
199
|
-
# TH Region Configuration
|
|
200
|
-
# =============================================================================
|
|
201
|
-
TH_REGION_CONFIG = RegionConfig(
|
|
202
|
-
region_id="th",
|
|
203
|
-
supports_futures=False,
|
|
204
|
-
supports_crypto=False,
|
|
205
|
-
supports_event_contracts=False,
|
|
206
|
-
supports_combo_orders=False,
|
|
207
|
-
supports_option_strategies=False,
|
|
208
|
-
supports_algo_orders=False,
|
|
209
|
-
valid_order_types=frozenset({
|
|
210
|
-
"MARKET", "LIMIT", "STOP_LOSS", "STOP_LOSS_LIMIT"
|
|
211
|
-
}),
|
|
212
|
-
valid_time_in_force=frozenset({"DAY", "GTC"}),
|
|
213
|
-
valid_trading_sessions=frozenset({"NIGHT", "ALL", "CORE", "ALL_DAY"}),
|
|
214
|
-
valid_combo_types=frozenset({"NORMAL"}),
|
|
215
|
-
valid_option_strategies=frozenset({"SINGLE"}),
|
|
216
|
-
valid_market_categories=frozenset({"US"}),
|
|
217
|
-
valid_order_markets=frozenset({"US"}),
|
|
218
|
-
valid_instrument_categories=frozenset({"US_STOCK", "US_ETF"}),
|
|
219
|
-
supports_options=False,
|
|
220
|
-
supports_fundamentals=True,
|
|
221
|
-
asset_type_account_classes={
|
|
222
|
-
"stock": frozenset({"INDIVIDUAL_CASH"}),
|
|
223
|
-
},
|
|
224
|
-
)
|
|
225
|
-
|
|
226
|
-
|
|
227
198
|
# =============================================================================
|
|
228
199
|
# MY Region Configuration
|
|
229
200
|
# =============================================================================
|
|
@@ -435,14 +406,15 @@ REGION_CONFIGS: dict[str, RegionConfig] = {
|
|
|
435
406
|
"hk": HK_REGION_CONFIG,
|
|
436
407
|
"jp": JP_REGION_CONFIG,
|
|
437
408
|
"sg": SG_REGION_CONFIG,
|
|
438
|
-
"th": TH_REGION_CONFIG,
|
|
439
409
|
"my": MY_REGION_CONFIG,
|
|
440
410
|
"uk": UK_REGION_CONFIG,
|
|
441
411
|
"mx": MX_REGION_CONFIG,
|
|
442
412
|
"br": BR_REGION_CONFIG,
|
|
443
|
-
"eu": EU_REGION_CONFIG,
|
|
444
413
|
"za": ZA_REGION_CONFIG,
|
|
445
|
-
|
|
414
|
+
# Note: TH, EU, and AU are not supported yet due to compliance
|
|
415
|
+
# requirements and are intentionally not registered, so selecting these
|
|
416
|
+
# regions raises UnsupportedRegionError. Their RegionConfig objects are
|
|
417
|
+
# kept defined above for quick re-enablement once compliance clears.
|
|
446
418
|
}
|
|
447
419
|
|
|
448
420
|
SUPPORTED_REGIONS: frozenset[str] = frozenset(REGION_CONFIGS.keys())
|
|
@@ -18,15 +18,12 @@ if TYPE_CHECKING:
|
|
|
18
18
|
|
|
19
19
|
# Region-specific 2FA documentation links
|
|
20
20
|
_2FA_GUIDE_LINKS: dict[str, str] = {
|
|
21
|
-
"au": "https://developer.webull.com.au/apis/docs/authentication/token",
|
|
22
21
|
"br": "https://developer.webull.com.br/apis/docs/authentication/token",
|
|
23
|
-
"eu": "https://developer.webull.eu/apis/docs/authentication/token",
|
|
24
22
|
"hk": "https://developer.webull.hk/apis/docs/authentication/token",
|
|
25
23
|
"jp": "https://developer.webull.co.jp/apis/docs/authentication/token",
|
|
26
24
|
"mx": "https://developer.webull.com.mx/apis/docs/authentication/token",
|
|
27
25
|
"my": "https://developer.webull.com.my/apis/docs/authentication/token",
|
|
28
26
|
"sg": "https://developer.webull.com.sg/apis/docs/authentication/token",
|
|
29
|
-
"th": "https://developer.webull.co.th/apis/docs/authentication/token",
|
|
30
27
|
"uk": "https://developer.webull-uk.com/apis/docs/authentication/token",
|
|
31
28
|
"us": "https://developer.webull.com/apis/docs/authentication/token",
|
|
32
29
|
"za": "https://developer.webull.co.za/apis/docs/authentication/token",
|
|
@@ -141,7 +138,7 @@ class DeviceNotRegisteredError(Exception):
|
|
|
141
138
|
# based on each request's api_type - no add_endpoint() calls needed.
|
|
142
139
|
UAT_ENDPOINTS: dict = {
|
|
143
140
|
"default_region": "us",
|
|
144
|
-
"regions": ["us", "hk", "jp", "sg", "
|
|
141
|
+
"regions": ["us", "hk", "jp", "sg", "my", "uk", "mx", "br", "za"],
|
|
145
142
|
"region_mapping": {
|
|
146
143
|
"us": {
|
|
147
144
|
"api": "api.sandbox.webull.com",
|
|
@@ -163,11 +160,6 @@ UAT_ENDPOINTS: dict = {
|
|
|
163
160
|
"quotes-api": "data-api.uat.webullbroker.com",
|
|
164
161
|
"events-api": "sg-events-api.uat.webullbroker.com",
|
|
165
162
|
},
|
|
166
|
-
"th": {
|
|
167
|
-
"api": "th-api.uat.webullbroker.com",
|
|
168
|
-
"quotes-api": "data-api.uat.webullbroker.com",
|
|
169
|
-
"events-api": "th-events-api.uat.webullbroker.com",
|
|
170
|
-
},
|
|
171
163
|
"my": {
|
|
172
164
|
"api": "my-api.uat.webullbroker.com",
|
|
173
165
|
"quotes-api": "data-api.uat.webullbroker.com",
|
|
@@ -188,21 +180,11 @@ UAT_ENDPOINTS: dict = {
|
|
|
188
180
|
"quotes-api": "us-openapi-quotes-api.uat.webullbroker.com",
|
|
189
181
|
"events-api": "us-openapi-events.uat.webullbroker.com",
|
|
190
182
|
},
|
|
191
|
-
"eu": {
|
|
192
|
-
"api": "eu-api.uat.webullbroker.com",
|
|
193
|
-
"quotes-api": "eu-api.uat.webullbroker.com",
|
|
194
|
-
"events-api": "eu-events-api.uat.webullbroker.com",
|
|
195
|
-
},
|
|
196
183
|
"za": {
|
|
197
184
|
"api": "au-api.uat.webullbroker.com",
|
|
198
185
|
"quotes-api": "au-api.uat.webullbroker.com",
|
|
199
186
|
"events-api": "au-events-api.uat.webullbroker.com",
|
|
200
187
|
},
|
|
201
|
-
"au": {
|
|
202
|
-
"api": "au-api.uat.webullbroker.com",
|
|
203
|
-
"quotes-api": "au-api.uat.webullbroker.com",
|
|
204
|
-
"events-api": "au-events-api.uat.webullbroker.com",
|
|
205
|
-
},
|
|
206
188
|
},
|
|
207
189
|
}
|
|
208
190
|
|
{webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/trading/order.py
RENAMED
|
@@ -16,6 +16,7 @@ from webull_openapi_mcp.formatters import (
|
|
|
16
16
|
extract_response_data,
|
|
17
17
|
format_open_orders,
|
|
18
18
|
format_order_detail,
|
|
19
|
+
format_order_executions,
|
|
19
20
|
format_order_history,
|
|
20
21
|
prepend_disclaimer,
|
|
21
22
|
)
|
|
@@ -173,3 +174,61 @@ def register_order_tools(
|
|
|
173
174
|
return prepend_disclaimer(format_order_detail(data))
|
|
174
175
|
except Exception as e:
|
|
175
176
|
return handle_sdk_exception(e, "get_order_detail")
|
|
177
|
+
|
|
178
|
+
@mcp.tool(
|
|
179
|
+
description=(
|
|
180
|
+
"List order execution records within a date range. "
|
|
181
|
+
"Returns per execution: execution_id, order_id, client_order_id, "
|
|
182
|
+
"symbol, execution_time, status, execution_type, side, order_type, "
|
|
183
|
+
"total_quantity, limit_price, filled_quantity, filled_price, "
|
|
184
|
+
"total_filled_qty, leaves_qty. "
|
|
185
|
+
"Currently supported for Webull HK accounts only."
|
|
186
|
+
),
|
|
187
|
+
annotations={"readOnlyHint": True},
|
|
188
|
+
)
|
|
189
|
+
async def list_order_executions(
|
|
190
|
+
account_id: str,
|
|
191
|
+
client_order_id: Optional[str] = None,
|
|
192
|
+
start_date: Optional[str] = None,
|
|
193
|
+
end_date: Optional[str] = None,
|
|
194
|
+
pagination_key: Optional[str] = None,
|
|
195
|
+
) -> str:
|
|
196
|
+
"""List order execution records within a specified date range.
|
|
197
|
+
|
|
198
|
+
Args:
|
|
199
|
+
account_id: Account ID.
|
|
200
|
+
client_order_id: Filter by the 3rd party order ID (optional).
|
|
201
|
+
start_date: Start date in the format yyyy-MM-dd (optional).
|
|
202
|
+
end_date: End date in the format yyyy-MM-dd (optional).
|
|
203
|
+
pagination_key: Pagination cursor from a previous response for the
|
|
204
|
+
next page (optional; omit for the first page).
|
|
205
|
+
"""
|
|
206
|
+
try:
|
|
207
|
+
account_id = normalize_account_id(account_id)
|
|
208
|
+
except ValueError as e:
|
|
209
|
+
return f"Validation error: {e}"
|
|
210
|
+
audit.log_tool_call("list_order_executions", {"account_id": account_id})
|
|
211
|
+
|
|
212
|
+
if client_order_id is not None:
|
|
213
|
+
try:
|
|
214
|
+
validate_client_order_id(client_order_id)
|
|
215
|
+
except Exception as e:
|
|
216
|
+
return f"Validation error: {e}"
|
|
217
|
+
|
|
218
|
+
try:
|
|
219
|
+
kwargs: dict = {}
|
|
220
|
+
if client_order_id:
|
|
221
|
+
kwargs["client_order_id"] = client_order_id
|
|
222
|
+
if start_date:
|
|
223
|
+
kwargs["start_date"] = start_date
|
|
224
|
+
if end_date:
|
|
225
|
+
kwargs["end_date"] = end_date
|
|
226
|
+
if pagination_key:
|
|
227
|
+
kwargs["pagination_key"] = pagination_key
|
|
228
|
+
response = sdk.trade.order_v3.list_order_executions(
|
|
229
|
+
account_id=account_id, **kwargs
|
|
230
|
+
)
|
|
231
|
+
data = extract_response_data(response)
|
|
232
|
+
return prepend_disclaimer(format_order_executions(data))
|
|
233
|
+
except Exception as e:
|
|
234
|
+
return handle_sdk_exception(e, "list_order_executions")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/market_data/crypto.py
RENAMED
|
File without changes
|
{webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/market_data/event.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/market_data/option.py
RENAMED
|
File without changes
|
|
File without changes
|
{webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/market_data/stock.py
RENAMED
|
File without changes
|
|
File without changes
|
{webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/trading/__init__.py
RENAMED
|
File without changes
|
{webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/trading/account.py
RENAMED
|
File without changes
|
{webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/trading/assets.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{webull_openapi_mcp-1.2.3 → webull_openapi_mcp-1.2.4}/webull_openapi_mcp/tools/trading/instrument.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|