MCP Tools Reference
TradeStaq's MCP server exposes 45 tools organized into 10 categories. Each tool can be called by any MCP-compatible AI client.
Authentication Scopes
For remote OAuth clients, tokens carry one of three scopes, hierarchical — mcp:live implies mcp:paper implies mcp:read. Session-cookie (dashboard) users bypass scope checks entirely.
| Scope | Meaning |
|---|---|
mcp:read | View-only. Safe for research agents — no writes, no trades, no charges. |
mcp:paper | Read + paper-trade writes (paper exchanges, paper bots). Cannot touch live money. |
mcp:live | Read + paper + live-money writes (live deploys, live exchange connections, wallet-charging tools). |
When a call needs a scope your token doesn't hold, the server returns 403 insufficient_scope. check_auth returns your current token's scope, tier capabilities, and Strategy Lab wallet balance — call it first to preflight what you can do before attempting a paid or live-money action. See Authentication for the full OAuth flow.
Tools that charge your Strategy Lab wallet (generate_strategy, start_optimization_run) follow a two-step confirm pattern: call once without acknowledgeCost to get a cost estimate with nothing charged or queued, then call again with acknowledgeCost: true after the user approves the spend.
Authentication (7 tools)
login
Sign in with email and password credentials. Returns an authentication token for subsequent requests.
| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | Yes | TradeStaq account email |
password | string | Yes | Account password |
authenticate
Start a browser-based OAuth flow — opens a login page in your browser, you authenticate there, and the token is saved automatically. No credentials enter the chat.
| Parameter | Type | Required | Description |
|---|---|---|---|
scope | string | No | OAuth scope to request: mcp:read, mcp:paper (default), or mcp:live. |
check_auth
Preflight check before invoking other tools. Returns the authenticated user, OAuth scope on the current token, tier capabilities (allowLiveTrading, allowAIBuilder, allowNewsTrading, allowMcpServer), Strategy Lab wallet balance, and the OAuth client name/expiry. Cached server-side for 30 seconds per token.
| Parameter | Type | Required | Description |
|---|---|---|---|
| — | — | — | No parameters required |
set_token
Manually set a JWT token for the current session — for headless environments, CI/CD, or passing tokens between systems.
| Parameter | Type | Required | Description |
|---|---|---|---|
token | string | Yes | JWT authentication token |
connect_exchange
Connect a real exchange account with API credentials. Supports Binance, Bybit, OKX, Hyperliquid, and 10+ others. Keys are encrypted and never exposed back to the client.
| Parameter | Type | Required | Description |
|---|---|---|---|
exchange | string | Yes | Exchange identifier (e.g. binance, bybit, okx, hyperliquid) |
apiKey | string | Yes | Your exchange API key |
apiSecret | string | Yes | Your exchange API secret |
passphrase | string | No | Required for OKX, KuCoin |
walletAddress | string | No | Required for Hyperliquid, dYdX |
create_paper_exchange
Create a paper-trading exchange with a simulated balance — no API keys required. Lets an agent test strategies, deploy bots, and place trades without risking real money.
Scope: mcp:paper or mcp:live. Session-cookie (dashboard) users can always call this.
| Parameter | Type | Required | Description |
|---|---|---|---|
platform | string | Yes | Exchange to simulate (e.g. binance, bybit, okx, hyperliquid) |
exchangeType | string | No | "spot" or "futures" (default: "spot") |
accountLabel | string | No | Friendly name for this paper account |
initialBalanceUsdt | number | No | Simulated starting balance in USDT (default: 10000) |
logout
Sign out and invalidate the current session token.
| Parameter | Type | Required | Description |
|---|---|---|---|
| — | — | — | No parameters required |
Market Data (4 tools)
get_price
Get the current real-time price for a trading pair on a specific exchange — bid, ask, last price, 24h change.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbol | string | Yes | Trading pair (e.g. BTC/USDT) |
exchange | string | No | Exchange to fetch from (default: binance) |
get_candles
Fetch historical OHLCV candlestick data for a trading pair — for technical analysis, backtesting prep, or trend review.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbol | string | Yes | Trading pair (e.g. BTC/USDT) |
exchange | string | No | Exchange to fetch from (default: binance) |
timeframe | string | No | Candle timeframe: 1m, 5m, 15m, 1h, 4h, 1d (default: 1h) |
limit | number | No | Number of candles to return (default: 100) |
list_exchanges
List every exchange TradeStaq supports, including markets, connection status, and feature support.
| Parameter | Type | Required | Description |
|---|---|---|---|
| — | — | — | No parameters required |
search_markets
Search for trading pairs across all connected exchanges.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Search query (e.g. BTC, SOL/USDT, ethereum) |
exchange | string | No | Filter by exchange |
Portfolio (2 tools)
get_portfolio
View total balance, holdings, allocation, and 24h P&L across all connected exchanges.
| Parameter | Type | Required | Description |
|---|---|---|---|
exchange | string | No | Filter by specific exchange |
get_positions
List all open trading positions — entry price, current P&L, leverage, margin, liquidation price.
| Parameter | Type | Required | Description |
|---|---|---|---|
exchange | string | No | Filter by specific exchange |
Strategies (10 tools)
list_strategies
Browse strategies — either the public marketplace or your own library.
| Parameter | Type | Required | Description |
|---|---|---|---|
owned | boolean | No | true = your own strategies; false (default) = public marketplace |
market | string | No | Filter by market type: spot, futures, both |
category | string | No | Filter by category, e.g. official, community, custom |
status | string | No | owned:true only — filter by status (comma-separated) |
pricing | string | No | owned:false only — filter by free/paid |
search | string | No | Filter by name/description substring |
sort | string | No | Sort order (varies by owned) |
limit | number | No | Max results, 1-100 (default: 50) |
get_strategy
Get full details for a strategy by ID — description, market/timeframe, performance stats, rating, and (if you own it or it's forkable) the code.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Strategy ID |
explain_strategy
Get a plain-English explanation of what a strategy does, its risk profile, and the market conditions it suits.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Strategy ID |
compare_strategies
Compare 2-5 strategies side by side on ROI, max drawdown, win rate, Sharpe ratio, rating, and active bot count.
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | string[] | Yes | 2-5 strategy IDs to compare |
create_strategy
Save a new strategy from existing TradeDroid code to your library. Use this when you already have the code (hand-written, or produced by generate_strategy).
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name |
description | string | No | Plain-English summary |
code | string | Yes | TradeDroid strategy code (JavaScript) |
market | string | No | "spot" or "futures" (default: futures) |
timeframe | string | No | Primary candle timeframe (default: 1h) |
update_strategy
Update one of your own strategies — name, description, category, tags, or the code itself. Code edits write to a draft version only; nothing live changes until you promote it.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Strategy ID to update |
name | string | No | New display name |
description | string | No | New description |
category | string | No | New category |
market | string | No | New market type |
tags | string[] | No | Replace the strategy's tags |
code | string | No | New strategy code — saved as a draft version |
status | string | No | Advance the publish workflow: draft→testing, testing→draft/live, live→testing/listed, listed→live |
generate_strategy
Generate a complete strategy from a natural-language description using AI (FORGE) — no coding required.
Scope: mcp:live. Wallet-charging — see Authentication Scopes above for the two-step confirm pattern.
| Parameter | Type | Required | Description |
|---|---|---|---|
description | string | Yes | Natural-language description of the strategy |
market | string | No | "spot" or "futures" (default: futures) |
timeframe | string | No | Primary candle timeframe (default: 1h) |
acknowledgeCost | boolean | No | Confirm the wallet charge to actually generate |
list_strategy_versions
List the full version history for one of your own strategies — every stored version, its validation status, and which channel (stable, beta, or none) it currently serves. stable is what every bot without a channel override actually runs.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Strategy ID |
validate_strategy_version
Run the automated validation pipeline (syntax check, entry/exit logic check, quick real-data backtest) against the current draft version of a strategy. Required before that version can be promoted to stable. Async — poll list_strategy_versions and watch validationStatus go pending → running → passed/failed.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Strategy ID whose latest/draft version to validate |
exchangeId | string | Yes | An exchange you own — sources historical candle data only, no real orders placed |
symbol | string | Yes | Trading pair to validate against, e.g. BTC/USDT |
promote_strategy_version
Promote a specific version to the stable or beta channel. Promoting to stable is the step that actually changes the code every bot on the default channel runs — editing (update_strategy) or validating a version has no effect on deployed bots until this is called. stable requires validationStatus: 'passed'; beta has no gate.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Strategy ID |
versionId | string | Yes | The specific version to promote, from list_strategy_versions |
channel | string | Yes | "stable" or "beta" |
Strategy Lab (4 tools)
AI-powered strategy optimization — see the Strategy Lab overview for how the underlying engine works. Every capability here is also available from the dashboard.
start_optimization_run
Start an AI optimization run on one of your own strategies — repeatedly mutates the code, backtests each variant, and keeps only the improvements, walk-forward validated on data no experiment trained on. This is different from generate_strategy, which writes one new strategy from a description; this iteratively improves an existing strategy you already own.
Scope: mcp:live. Wallet-charging per experiment — see Authentication Scopes above. Only one run can be active per user at a time.
| Parameter | Type | Required | Description |
|---|---|---|---|
strategyId | string | Yes | ID of your own strategy to optimize |
exchangeId | string | Yes | An exchange you own — sources historical candle data |
symbol | string | No | Trading pair to optimize against (default: BTC/USDT) |
timeframe | string | No | Candle timeframe (default: 1h) |
maxExperiments | number | No | Mutate-and-backtest experiments to run, 1-30 (default: 20) |
scoringProfile | string | No | balanced, conservative, aggressive, or consistency (default: balanced) |
startDate / endDate | string | No | ISO dates for the backtest window (default: last 6 months) |
trainSplit | number | No | Fraction used for training vs. out-of-sample validation, 0.5-0.9 (default: 0.7) |
userGuidance | string | No | Free-text steering for the AI mutations (max 2000 chars) |
autoPromote | boolean | No | Auto-promote the result to stable if it clears a strict validation bar (default: false) |
acknowledgeCost | boolean | No | Confirm the wallet charge to actually start the run |
get_optimization_status
Check progress of a run started with start_optimization_run. Each experiment typically takes 1-2+ minutes — poll every 15-30 seconds rather than tight-looping. A completed or failed run stays queryable for 24 hours.
| Parameter | Type | Required | Description |
|---|---|---|---|
jobId | string | Yes | Job ID returned by start_optimization_run |
cancel_optimization_run
Cancel a run you started. Takes effect after the current experiment finishes, not instantly — confirm with get_optimization_status. Any improvement already saved stays saved.
| Parameter | Type | Required | Description |
|---|---|---|---|
jobId | string | Yes | Job ID to cancel |
send_optimization_guidance
Inject live, free-text steering into a running optimization. Applies starting with the next experiment, not the one in flight — overwrites any previously-injected guidance for this run.
| Parameter | Type | Required | Description |
|---|---|---|---|
jobId | string | Yes | Job ID to steer |
guidance | string | Yes | Free-text guidance for the AI (max 2000 chars) |
Backtesting (3 tools)
what_if_backtest
Run a backtest on a strategy against historical data. Async, typically 30-120 seconds.
| Parameter | Type | Required | Description |
|---|---|---|---|
strategyId | string | Yes | Strategy to backtest |
symbol | string | Yes | Trading pair |
exchange | string | Yes | Exchange account ID for market data |
timeframe | string | No | Candle timeframe (default: 1h) |
get_backtest_results
Check status and results of a previously started backtest.
| Parameter | Type | Required | Description |
|---|---|---|---|
jobId | string | Yes | Backtest job ID |
export_backtest
Get export links for a completed backtest — CSV and PDF download URLs.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Backtest ID |
Bot Management (9 tools)
list_bots
List all your bots with status and performance.
| Parameter | Type | Required | Description |
|---|---|---|---|
status | string | No | Filter by status (running, stopped, error) |
get_bot_status
Get detailed status, configuration, and live performance for a specific bot — run status, strategy/symbol/exchange, paper or live, P&L, win rate, trade count, risk config. Read-only.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The bot ID to inspect |
deploy_bot
Deploy a strategy as a trading bot. Defaults to paper trading for safety — whether a bot trades real money is determined by the exchange account it's attached to, not by a flag alone.
Scope: mcp:paper for a paper exchange target; mcp:live for a live exchange target.
| Parameter | Type | Required | Description |
|---|---|---|---|
strategyId | string | Yes | Strategy to deploy |
exchangeId | string | Yes | Exchange account ID |
symbol | string | Yes | Trading pair |
market | string | No | "spot" or "futures" (default: spot) |
live | boolean | No | Must match the target exchange's own paper/live status (default: false) |
positionSizePercent | number | No | Position size as % of account balance (default: 10) |
stopLoss / takeProfit | number | No | Risk parameters, e.g. 5 for 5% |
start_bot
Activate a bot so it starts opening new positions on its next scheduled interval. Newly deployed bots come up paused by default.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The bot ID to activate |
stop_bot
Stop a bot from opening new positions. Existing open positions stay open — close those separately with close_position. Reversible; restart with start_bot.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The bot ID to stop |
update_bot
Update a bot's risk configuration — leverage, position size, stop loss, take profit, or trade notifications — without redeploying it.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The bot ID to update |
leverage | number | No | New leverage (futures only) |
positionSizePercent | number | No | New position size as % of account balance |
stopLoss / takeProfit | number | No | New risk parameters |
notifyOnTrade | boolean | No | Send a Telegram notification per trade |
delete_bot
Permanently delete a bot and its configuration — irreversible. Refused if the bot still has an open trade recorded; close_position and stop_bot it first.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The bot ID to delete |
export_bot_trades
Export a bot's trade history — every closed trade with entry/exit prices and P&L, plus a performance summary.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The bot ID whose trades to export |
format | string | No | "summary" (default) or "full" |
close_position
Close an open position at market price, fully or partially. Moves real money when the position is live.
| Parameter | Type | Required | Description |
|---|---|---|---|
exchangeId | string | Yes | Exchange account ID where the position is open |
symbol | string | Yes | Trading pair, e.g. BTC/USDT |
side | string | Yes | "long" or "short" |
percentage | number | No | Percentage to close, 1-100 (default: 100) |
Trade History (2 tools)
get_trade_history
View complete trade history — entry/exit prices, P&L per trade, timestamps, triggering strategy.
| Parameter | Type | Required | Description |
|---|---|---|---|
botId | string | No | Filter by bot ID |
exchange | string | No | Filter by exchange |
limit | number | No | Number of trades to return (default: 50) |
get_performance_metrics
Get aggregated performance metrics — total P&L, win rate, average return, Sharpe ratio, max drawdown — over 7d/30d/90d windows.
| Parameter | Type | Required | Description |
|---|---|---|---|
period | string | No | 7d, 30d, 90d, all (default: 30d) |
botId | string | No | Filter by bot ID |
Copy Trading (2 tools)
list_top_traders
Discover top-performing traders on the leaderboard — win rate, total return, drawdown, followers.
| Parameter | Type | Required | Description |
|---|---|---|---|
period | string | No | 7d, 30d, 90d (default: 30d) |
limit | number | No | Number of traders to return (default: 10) |
follow_trader
Start copy trading a top-performing trader — their trades mirror automatically on your connected exchange.
Scope: mcp:paper for a paper exchange target; mcp:live for a live exchange target.
| Parameter | Type | Required | Description |
|---|---|---|---|
traderId | string | Yes | The trader ID or alias to follow |
exchange | string | Yes | Exchange to copy trades on |
amount | number | Yes | Maximum position size per trade |
AI Advisor (2 tools)
suggest_strategies
Get AI-powered strategy recommendations based on current market conditions, portfolio, and risk tolerance.
| Parameter | Type | Required | Description |
|---|---|---|---|
riskLevel | string | No | conservative, moderate (default), aggressive |
market | string | No | spot or futures |
get_market_context
Get a real-time market analysis snapshot — trend direction, volatility, support/resistance, sentiment.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbol | string | Yes | Trading pair to analyze |
exchange | string | No | Exchange for data (default: binance) |
Next Steps
- Setup Guide — Configure your AI client
- Authentication — How to authenticate
- Strategy Lab Overview — How AI optimization works
- Troubleshooting — Common errors and fixes