Docs menu

Tools reference

The seven tools of the AIStrategyMiner MCP server, with what each does, its input fields and what it returns.

The MCP server has 7 tools. Every tool returns its result as one JSON text. When a tool fails, the result is marked as an error and holds an error code or a list of messages. No tool returns source code or compiled files.

ToolWhat it doesWrites anything?
list_node_vocabularyLists block types with their settings.No
list_templatesLists ready-made strategies.No
get_templateReturns one template as a flow.No
validate_flowChecks a flow and lists errors and warnings.No
create_builder_linkSaves a valid flow and returns a Strategy Builder link.Yes, a shared flow record
open_strategy_minerReturns a Strategy Miner link with settings filled in.No
get_miner_resultsReads a result summary by ID.No

The input tables below are generated from the server’s own definitions in worker/api/mcp.ts. A check in the build fails if this page drifts from them.

list_node_vocabulary

Lists the block types the Strategy Builder supports: indicators, conditions, orders, filters, exits and others. Each entry has the type name, category, label, description, input and output port counts, the settings (key, label, type, options, minimum, maximum and default), and whether the block can be used only once in a flow. Labels are in English.

The result also holds the list of categories, the count of blocks, the flow shape the other tools expect, and a note on ports: connect output_N of one block to input_N of the next, Start has no input, and every block must be reachable from Start.

FieldTypeRequiredDescription
categorystringNoe.g. indicator, condition, action

list_templates

Lists the ready-made strategies of the Strategy Builder. Each entry has an id, a name, a description, and portfolio, which is true when the template holds several flows. Pro-only recipes are not listed and cannot be fetched through MCP. Names and descriptions are in English, the same as on the Builder screen in English.

This tool takes no input.

get_template

Returns one template as a flow, in the exact shape that validate_flow and create_builder_link accept. Use it as a model or a starting point. The result has id, name, description and flow (with name, settings and flows).

Errors: not_found when the ID is unknown, and rate_limited when the template limit is exceeded. This tool has its own limit of 10 calls per 60 seconds per IP address.

FieldTypeRequiredDescription
idstringYesTemplate id from list_templates

validate_flow

Checks a flow with the same engine the Strategy Builder uses. The result has valid (true when there are no errors), errors (must fix) and warnings (review). Each item has code, type, severity, nodeId, name, message and flow (the index of the flow it belongs to).

Error codes, as they appear in code:

CodeMeaning
EAB-E201Loop
EAB-E202No Start block
EAB-E203Unreachable block
EAB-E204Unconnected input
EAB-E205Indicator wired straight into an order
EAB-E206Duplicate single-use block

If the flow is not in a readable shape at all (for example an unknown block type), the result is an error with valid: false and input_errors, a list of messages. A flow may hold at most 8 flows with at most 60 blocks each, and at most 256 KB in total.

FieldTypeRequiredDescription
flowobjectYes
flow.namestringNoShort plain name, letters/digits/spaces
flow.settingsobjectNoShared EA settings (same shape as get_template settings); omit for defaults
flow.flowsarray of objectYesUsually one flow. Several flows = a portfolio EA, one Start node each.
flow.flows[].nodesarray of objectYes
flow.flows[].nodes[].idstringYesUnique within the flow, e.g. n1
flow.flows[].nodes[].typestringYesA node type from list_node_vocabulary
flow.flows[].nodes[].xnumberNo
flow.flows[].nodes[].ynumberNo
flow.flows[].nodes[].dataobject (values: string or number or boolean)NoParameter values keyed by property key
flow.flows[].connectionsarray of objectNo
flow.flows[].connections[].fromstringYes
flow.flows[].connections[].tostringYes
flow.flows[].connections[].outputstringNo
flow.flows[].connections[].inputstringNo
flow.flows[].settingsobjectNo

Validates the flow. If it has no errors, the tool saves it and returns a Strategy Builder link that opens it on the canvas. The result has saved: true, url, warnings and next_steps.

If the flow has errors, nothing is saved. The result is an error with errors (same list as validate_flow) or input_errors. When the daily limit is reached, the error is daily_limit. Links last 90 days. See Limits and safety.

The Strategy Builder canvas after opening a Builder link: the flow is placed and connected.
Opening the link places the saved flow on the canvas.
FieldTypeRequiredDescription
flowobjectYes
flow.namestringNoShort plain name, letters/digits/spaces
flow.settingsobjectNoShared EA settings (same shape as get_template settings); omit for defaults
flow.flowsarray of objectYesUsually one flow. Several flows = a portfolio EA, one Start node each.
flow.flows[].nodesarray of objectYes
flow.flows[].nodes[].idstringYesUnique within the flow, e.g. n1
flow.flows[].nodes[].typestringYesA node type from list_node_vocabulary
flow.flows[].nodes[].xnumberNo
flow.flows[].nodes[].ynumberNo
flow.flows[].nodes[].dataobject (values: string or number or boolean)NoParameter values keyed by property key
flow.flows[].connectionsarray of objectNo
flow.flows[].connections[].fromstringYes
flow.flows[].connections[].tostringYes
flow.flows[].connections[].outputstringNo
flow.flows[].connections[].inputstringNo
flow.flows[].settingsobjectNo

open_strategy_miner

Returns a link that opens the Strategy Miner with settings already filled in. It does not run the generator and does not export anything. You press Generate in the browser. The full generator is part of Pro. Without Pro, the link opens the demo.

The result has:

  • url: the link.
  • applied: the settings that went into the link.
  • dropped: settings that were left out, each with the field, the value and the reason. A value outside its range, a wrong type, an unknown part name and a contradictory pair (for example period_min above period_max) are dropped. They are not rounded or repaired.
  • notices: remarks about the choices that were kept, for example that an add-on symbol needs a one-time price-data download.
  • next_steps: what to tell the user.

Rules for the settings:

  • All fields are optional. A link with no field opens the Miner with its defaults.
  • Realistic cost settings (spread_pips to friday_close_hour) apply for that visit only. They are shown on screen, never overwrite your saved account settings, and take effect only with Pro. The demo ignores them.
  • Advanced settings (parts_only to filters) are filled into the Advanced section for that visit only and never overwrite your saved advanced settings. Ranges that need two ends (conds_min and conds_max, sl_min_pips and sl_max_pips, tp_min_pips and tp_max_pips) are dropped if only one end is given.
  • The ranges of some fields differ by symbol. Gold (XAUUSD) allows a wider spread. Gold, US Tech 100, US30, DE40, JP225 and the two oil symbols also allow wider stop-loss and take-profit ranges. A value outside the range for the symbol is dropped, and the reason names that range.
  • trials in the link accepts 1000, 2000, 5000, 10000 or 20000, the same values as the Trial limit list on the Miner screen.
  • target only records the intended export format. You choose the target again in the Builder after you open a candidate.
The Strategy Miner opened from a link with Symbol, Timeframe, Period, Direction and Trial limit already set.
The settings from the link are in the fields. Nothing runs until you click Generate.
The note shown when a link carries cost settings, with the Spread and Commission fields filled in.
Cost settings from a link are shown on screen and apply to this run only. Your saved settings stay as they were.
FieldTypeRequiredDescription
symbolstringNoe.g. USDJPY (EURUSD USDJPY AUDUSD USDCAD NZDUSD USDCHF EURGBP GBPUSD; add-on symbols AUDCAD AUDCHF AUDJPY AUDNZD CADCHF CADJPY CHFJPY EURAUD EURCAD EURCHF EURJPY GBPAUD GBPCAD GBPCHF GBPJPY GBPNZD NZDJPY XAUUSD (gold) XAGUSD (silver; 1 lot = 5000 oz, 1 pip = $0.01) USA500IDXUSD (S&P 500 index; 1 lot = 1 index unit, 1 pip = 1 point; data from 2019, no 8/10 years) USATECHIDXUSD (Nasdaq 100) USA30IDXUSD (Dow) DEUIDXEUR (DAX) GBRIDXGBP (FTSE 100) JPNIDXJPY (Nikkei 225; same index definition) LIGHTCMDUSD (WTI crude oil; 1 lot = 1000 barrels assumed, 1 pip = $0.01) BRENTCMDUSD (Brent crude oil; same definition) need a one-time price-data download in the generator)
timeframestringNoH1, H4, D1, M15 or M30 (M15 and M30 use up to 5 years)
directionstringNolong (buy only), short (sell only) or both
targetstringNomql5, mql4, pine, ctrader or python
yearsnumberNoTest period in years: 2-5, or 8 or 10 (long period, Pro only; others get the 4-year demo)
trialsnumberNoTrial limit: 1000, 2000, 5000, 10000 or 20000
min_tradesnumberNoMinimum trades, 20-1000
seednumberNoRandom seed 1-99999 (same seed, same result)
familiesarray of stringNoEntry node families: ma, rsi, bb, macd, stoch, donch
spread_pipsnumberNoRealistic costs: spread in pips, 0-50 (0-500 for XAUUSD, whose default is 60)
commissionnumberNoRealistic costs: commission in USD per lot, round turn, 0-100
swap_longnumberNoRealistic costs: swap for buys per lot per night, -1000 to 1000 (unit: swap_unit)
swap_shortnumberNoRealistic costs: swap for sells per lot per night, -1000 to 1000
swap_unitstringNopoints or money (USD)
triple_swap_daynumberNoTriple-swap weekday, 1 (Mon) to 5 (Fri); the generator default is 3 (Wed)
rollover_hournumberNoDay change hour in server time, 0-23
session_startnumberNoNew entries allowed from this hour, 0-24
session_endnumberNoNew entries allowed until this hour, 0-24
min_stop_pipsnumberNoBroker minimum stop distance in pips, 0-500
sl_slippage_pipsnumberNoStop-loss slippage in pips, 0-100
gap_fillbooleanNoFill at the open when the price gaps past a stop or target
friday_close_hournumberNoFriday close hour in server time, 1-20, 0 = off
parts_onlyarray of stringNoAdvanced: the only indicator parts the search may use (all others are off). Names: ma, rsi, bb, macd, stoch, donch, atr, stddev, wpr, cci, mom, roc, dpo, trix, dem, adx, adxw, rvi, ult, osma, ao, ac, bears, bulls, sar, ha, dema, tema, hma, env, kc, ama, frama, vidya, cons, perf, ichi, alli, gat, ohlc, st, qqe, vldmi, orb, obv, vol, ad, bwmfi, mfi, force, chaikin, vwap. The 46 parts after donch are off by default and slow the search
parts_morearray of stringNoAdvanced: parts to pick more often (naming one that is off by default turns it on)
parts_lessarray of stringNoAdvanced: parts to pick less often
period_minnumberNoAdvanced: smallest indicator period, whole number 2-400
period_maxnumberNoAdvanced: largest indicator period, whole number 2-400 (at least period_min)
period_stepnumberNoAdvanced: period step, whole number 1-400
conds_minnumberNoAdvanced: fewest entry conditions, 1-4
conds_maxnumberNoAdvanced: most entry conditions, 1-4 (at least conds_min)
allow_andbooleanNoAdvanced: allow all conditions must hold (AND)
allow_orbooleanNoAdvanced: allow any one condition is enough (OR)
allow_notbooleanNoAdvanced: allow a comparison to be reversed (NOT)
lookbacknumberNoAdvanced: how many extra bars back a condition may look, 0-5
sl_min_pipsnumberNoAdvanced: smallest stop loss in pips, whole number 5-300; XAUUSD 200-10000
sl_max_pipsnumberNoAdvanced: largest stop loss in pips, whole number 5-300; XAUUSD 200-10000 (at least sl_min_pips)
tp_min_pipsnumberNoAdvanced: smallest take profit in pips, whole number 5-400; XAUUSD 200-10000
tp_max_pipsnumberNoAdvanced: largest take profit in pips, whole number 5-400; XAUUSD 200-10000 (at least tp_min_pips)
hours_modestringNoAdvanced: time-of-day filter. off, fixed (use hours_start and hours_end) or random (the search decides)
hours_startnumberNoAdvanced: entry window start hour, server time, whole number 0-23 (with hours_end; implies fixed)
hours_endnumberNoAdvanced: entry window end hour, 0-23, at least 2 hours after hours_start (no overnight range)
filtersarray of stringNoAdvanced: extra filters the search may use: sess, wd, gt, hlr, cp, mad

get_miner_results

Reads a result summary that a Pro user handed over with the Hand to AI button on the Strategy Miner results screen. You copy the result ID from that screen and give it to your AI. The button is Pro only. The demo has no Hand to AI button, so without Pro there is no ID to give.

The result holds the settings used, the realistic-cost settings if they were on, the totals, a table of how many candidates each check removed and why, the robustness tests, and the metrics of each candidate: search period, later period, other symbols, robustness, drawdown, and bars where the stop and the target were both reached. It holds no strategy design, no conditions and no code.

Errors: not_found when the ID is unknown, expired or deleted, and rate_limited when the limit of 20 calls per 60 seconds per IP address is exceeded. An ID expires 30 days after it is created, and you can delete it earlier on the results screen.

The Hand to AI box on the results screen after saving: the result ID, its expiry date and the Delete this id button.
Copy the result ID from this box and give it to your AI.
FieldTypeRequiredDescription
idstringYesThe result id the user copied from the results screen