{"serverId":"mcp-registry/com.benawf/mcp","tools":[{"name":"add_entry_gate","fixed":{"name":"add_entry_gate","description":"Add one AND entry gate. Args: side + condition JSON. You are the DSL translator. Invent the section JSON (condition/position/exit/cooldown). Browser applies only — BenAwf does not call an LLM. No prose text.","inputSchema":{"type":"object","$schema":"http://json-schema.org/draft-07/schema#","required":["side","condition"],"properties":{"side":{"enum":["long","short"],"type":"string","description":"entry.long or entry.short."},"condition":{"anyOf":[{"type":"object","required":["kind","left","op","right"],"properties":{"op":{"enum":["gt","lt","gte","lte","crosses_above","crosses_below"],"type":"string","description":"Comparison operator. crosses_above/crosses_below require previous bar context."},"kind":{"type":"string","const":"comparison"},"left":{"anyOf":[{"type":"object","required":["kind","field","timeframeMinutes","lookback"],"properties":{"kind":{"type":"string","const":"price"},"field":{"enum":["open","high","low","close"],"type":"string","description":"Bar field: open, high, low, or close (default close). Ignored at `lookback: 0` (live ticker). At `lookback >= 1` returns this OHLC field of bar N back — enables wick/rejection patterns (e.g. high pierced a level then close reclaimed)."},"lookback":{"type":"integer","maximum":20,"minimum":0,"description":"How many bars back to look. 0 = latest bar, 1 = one bar ago, etc. Max 20."},"timeframeMinutes":{"type":"integer","description":"Chart timeframe (5, 15, 60, 240, or 1440 minutes) the lookback resolves against. `lookback: 0` returns the live ticker price (timeframe-independent); `lookback >= 1` returns the chosen `field` of bar N back on this timeframe."}},"additionalProperties":false},{"type":"object","required":["kind","value"],"properties":{"kind":{"type":"string","const":"constant"},"value":{"type":"number"}},"additionalProperties":false},{"type":"object","required":["kind","name","field","timeframeMinutes","lookback","params"],"properties":{"kind":{"type":"string","const":"indicator"},"name":{"type":"string","description":"Indicator name. One of: SMA20, SMA50, EMA, RSI, ADX, MACD, BBANDS, ATR, ATR_PCT, VWAP, OBV, OBV_CHANGE, LAST_DAY_HIGH, LAST_DAY_LOW, LAST_WEEK_HIGH, LAST_WEEK_LOW, SWING_HIGH, SWING_LOW, BOS, CHOCH, DISPLACEMENT, VOLUME_PROFILE, DEALING_RANGE."},"field":{"enum":["value","signal","histogram","upper","middle","lower","poc","vah","val","equilibrium","premium_pct"],"type":"string","description":"Sub-field for composite indicators: MACD uses signal/histogram, BBANDS uses upper/middle/lower, VOLUME_PROFILE uses poc/vah/val, DEALING_RANGE uses equilibrium/premium_pct. Use value for scalar indicators."},"params":{"type":"object","required":["wing","atrMult","lookbackBars"],"properties":{"wing":{"anyOf":[{"type":"integer","maximum":10,"minimum":1},{"type":"null"}],"description":"Pivot wing for SWING_HIGH/SWING_LOW/BOS/CHOCH/DEALING_RANGE: bars required on each side to confirm a pivot. Default 3. Smaller (1–2) = short-term structure, larger (4–10) = major swings only."},"atrMult":{"anyOf":[{"type":"number","maximum":5,"minimum":0.5},{"type":"null"}],"description":"ATR(14) multiplier for DISPLACEMENT: bar range must exceed atrMult × ATR to count as displacement. Default 1.5."},"lookbackBars":{"anyOf":[{"type":"integer","maximum":100,"minimum":10},{"type":"null"}],"description":"Rolling window length for VOLUME_PROFILE (bars ending at the current closed bar). Default 48. Must fit the entry-rules indicator window (≤100)."}},"description":"Optional indicator parameters (e.g. swing pivot wing, VOLUME_PROFILE lookbackBars). Empty object = defaults.","additionalProperties":false},"lookback":{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/0/properties/lookback"},"timeframeMinutes":{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/0/properties/timeframeMinutes","description":"Chart timeframe: 5, 15, 60, 240 (4h), or 1440 (daily) minutes."}},"additionalProperties":false},{"type":"object","required":["kind","zoneType","state","field","timeframeMinutes","lookback"],"properties":{"kind":{"type":"string","const":"zone"},"field":{"enum":["top","bottom","mid"],"type":"string","description":"Zone price level: top or bottom edge, or mid (midpoint — the FVG 'consequent encroachment'). Default mid."},"state":{"enum":["open","tapped","mitigated"],"type":"string","description":"Which zones to consider: open = untouched, tapped = wick entered but no close through, mitigated = closed beyond the far edge. Default open."},"lookback":{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/0/properties/lookback"},"zoneType":{"enum":["fvg_bull","fvg_bear","ob_bull","ob_bear"],"type":"string","description":"fvg_bull/fvg_bear = 3-candle fair value gap (imbalance). ob_bull/ob_bear = last opposite-close candle before a displacement bar (order block)."},"timeframeMinutes":{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/0/properties/timeframeMinutes","description":"Chart timeframe the zone detection runs on: 5, 15, 60, 240 (4h), or 1440 (daily) minutes."}},"additionalProperties":false},{"type":"object","required":["kind","fn","a","b"],"properties":{"a":{"anyOf":[{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/0"},{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/1"},{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/2"},{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/3"}],"description":"First input — a primitive operand (price, indicator, or constant). No nesting."},"b":{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/4/properties/a","description":"Second input — a primitive operand (price, indicator, or constant). No nesting."},"fn":{"enum":["spread","ratio","abs_distance_pct"],"type":"string","description":"spread = a - b (same units as inputs). ratio = a / b (fails when b is 0). abs_distance_pct = |a - b| / |b| * 100 (percent points — same scale as ATR_PCT and SL/TP)."},"kind":{"type":"string","const":"derived"}},"additionalProperties":false}]},"right":{"$ref":"#/properties/condition/anyOf/0/properties/left"}},"additionalProperties":false},{"type":"object","required":["kind","startUtc","endUtc","timeframeMinutes"],"properties":{"kind":{"type":"string","const":"time_window"},"endUtc":{"$ref":"#/properties/condition/anyOf/1/properties/startUtc","description":"Window end, exclusive. Earlier than startUtc = overnight window (e.g. \"02:00\" with start \"22:00\"). Equal to startUtc = always in window."},"startUtc":{"type":"string","description":"Window start, inclusive (e.g. \"09:30\" for the New York killzone open)."},"timeframeMinutes":{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/0/properties/timeframeMinutes","description":"Chart timeframe whose latest closed bar provides the clock. Use 5 or 15 for killzone precision."}},"additionalProperties":false},{"type":"object","required":["kind","days","timeframeMinutes"],"properties":{"days":{"type":"array","items":{"enum":["sun","mon","tue","wed","thu","fri","sat"],"type":"string"},"maxItems":7,"minItems":1,"description":"Allowed UTC weekdays (e.g. omit \"fri\" to skip Friday)."},"kind":{"type":"string","const":"day_of_week"},"timeframeMinutes":{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/0/properties/timeframeMinutes","description":"Chart timeframe whose latest closed bar provides the clock. Use 5 or 15 for precision."}},"additionalProperties":false}],"description":"Translator-shaped entry gate condition."},"strategy_id":{"type":"string","minLength":1,"description":"Strategy id. Prefer always: routes to that Lab tab, and NO_ACTIVE_LAB errors include a direct Lab URL to open."}},"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false}},"changes":[{"kind":"annotations","detail":"Added readOnlyHint: false, destructiveHint: false, idempotentHint: false (inferred from the name).","verify":true}],"tokensBefore":2142,"tokensAfter":2142},{"name":"delete_entry_gate","fixed":{"name":"delete_entry_gate","description":"Remove one entry gate by id (from get_experiment). Args: id only. Refuses when it would leave both long and short with zero gates.","inputSchema":{"type":"object","$schema":"http://json-schema.org/draft-07/schema#","required":["id"],"properties":{"id":{"type":"string","maxLength":32,"minLength":1,"description":"Gate id shown in Live rules or get_experiment."},"strategy_id":{"type":"string","minLength":1,"description":"Strategy id. Prefer always: routes to that Lab tab, and NO_ACTIVE_LAB errors include a direct Lab URL to open."}},"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":true,"idempotentHint":true}},"changes":[{"kind":"annotations","detail":"Added readOnlyHint: false, destructiveHint: true, idempotentHint: true (inferred from the name).","verify":true}],"tokensBefore":170,"tokensAfter":170},{"name":"get_backtest","fixed":{"name":"get_backtest","description":"Cache-or-run one sim for an @R# + window, then return Score, trade count, PnL, drawdown, and bounded stats for one run. Numbers only — no BenAwf assessment LLM; you analyze. Same @R# + window → cached @B# (identical stats; follow the comment). After any mutate pass that result's dsl_ref. If you changed rules behind the same R#/draft, or suspect a stale cached @B#, pass force:true to force a fresh sim — never extrapolate from a cached B# of a different rules state.","inputSchema":{"type":"object","$schema":"http://json-schema.org/draft-07/schema#","required":["ref"],"properties":{"ref":{"type":"string","maxLength":32,"minLength":1,"description":"@R# to sim. After mutate use that result's dsl_ref, not the Live-rules header."},"force":{"type":"boolean","description":"Skip the cache and force a fresh sim for this @R# + window. Use after any rule change on the same R#/draft, or whenever a cached B# is suspect."},"config":{"type":"object","required":["asset","start_date","end_date","initial_balance","max_drawdown"],"properties":{"asset":{"enum":["BTC","ETH","SOL","XRP","BNB","LTC","LINK","DOGE","PEPE","SHIB","SPY","QQQ","IWM","DIA","VOO","XLF","XLE","XLK","XLV","XLP","XLY","XLU","XLI","XLB","XLRE","XLC","SMH","ARKK","GLD","SLV","TLT","HYG","EEM","AAPL","MSFT","GOOGL","AMZN","NVDA","META","TSLA","AVGO","ORCL","ADBE","CRM","AMD","QCOM","TXN","INTC","INTU","IBM","NOW","AMAT","MU","ARM","MRVL","PANW","CRWD","DDOG","NET","SNOW","PLTR","SMCI","DELL","APP","SHOP","UBER","ABNB","NFLX","COIN","HOOD","PYPL","JPM","BAC","WFC","C","GS","MS","V","MA","AXP","SCHW","BLK","SPGI","CME","COF","UNH","JNJ","LLY","PFE","MRK","ABBV","TMO","ABT","AMGN","ISRG","MDT","BMY","GILD","CVS","WMT","COST","HD","MCD","NKE","SBUX","TGT","LOW","PG","KO","PEP","PM","MO","CL","EL","DIS","BKNG","MAR","CAT","DE","BA","GE","HON","UPS","RTX","LMT","XOM","CVX","COP","SLB","NEE","DUK","SO","F","T","VZ","CMCSA","TMUS","XAUUSD","XAGUSD"],"type":"string","description":"Single symbol to sim (e.g. BTC)."},"end_date":{"type":"string","format":"date-time"},"start_date":{"type":"string","format":"date-time"},"max_drawdown":{"type":"number","maximum":100,"minimum":0.01},"initial_balance":{"type":"number","exclusiveMinimum":0}},"description":"Window + capital. Omit to reuse the previous run's window. Do not send empty strings or zeros.","additionalProperties":false},"strategy_id":{"type":"string","minLength":1,"description":"Strategy id. Prefer always: routes to that Lab tab, and NO_ACTIVE_LAB errors include a direct Lab URL to open."}},"additionalProperties":false},"annotations":{"readOnlyHint":true}},"changes":[{"kind":"annotations","detail":"Added readOnlyHint: true (inferred from the name).","verify":true}],"tokensBefore":720,"tokensAfter":720},{"name":"get_experiment","fixed":{"name":"get_experiment","description":"Prose summary plus rules JSON (entry gates with ids, position, exit, cooldownMinutes) and that iteration's @B# refs. Read before inventing translator-shaped mutate args.","inputSchema":{"type":"object","$schema":"http://json-schema.org/draft-07/schema#","required":["ref"],"properties":{"ref":{"type":"string","maxLength":32,"minLength":1,"description":"DSL iteration ref @R# (e.g. R2 or @R2)."},"strategy_id":{"type":"string","minLength":1,"description":"Strategy id. Prefer always: routes to that Lab tab, and NO_ACTIVE_LAB errors include a direct Lab URL to open."}},"additionalProperties":false},"annotations":{"readOnlyHint":true}},"changes":[{"kind":"annotations","detail":"Added readOnlyHint: true (inferred from the name).","verify":true}],"tokensBefore":178,"tokensAfter":178},{"name":"get_lineage","fixed":{"name":"get_lineage","description":"Champion @R#, per-iteration verdicts, levers tried/untried/failed on champion, converged flag, and user canvas view vs recommended working @R#.","inputSchema":{"type":"object","$schema":"http://json-schema.org/draft-07/schema#","properties":{"strategy_id":{"type":"string","minLength":1,"description":"Strategy id. Prefer always: routes to that Lab tab, and NO_ACTIVE_LAB errors include a direct Lab URL to open."}},"additionalProperties":false},"annotations":{"readOnlyHint":true}},"changes":[{"kind":"annotations","detail":"Added readOnlyHint: true (inferred from the name).","verify":true}],"tokensBefore":135,"tokensAfter":135},{"name":"get_market_context_by_date","fixed":{"name":"get_market_context_by_date","description":"OHLCV and cited indicators around that date (engine lookback each side).","inputSchema":{"type":"object","$schema":"http://json-schema.org/draft-07/schema#","required":["symbol","date","time_frame"],"properties":{"date":{"type":"string","format":"date-time"},"symbol":{"enum":["BTC","ETH","SOL","XRP","BNB","LTC","LINK","DOGE","PEPE","SHIB","SPY","QQQ","IWM","DIA","VOO","XLF","XLE","XLK","XLV","XLP","XLY","XLU","XLI","XLB","XLRE","XLC","SMH","ARKK","GLD","SLV","TLT","HYG","EEM","AAPL","MSFT","GOOGL","AMZN","NVDA","META","TSLA","AVGO","ORCL","ADBE","CRM","AMD","QCOM","TXN","INTC","INTU","IBM","NOW","AMAT","MU","ARM","MRVL","PANW","CRWD","DDOG","NET","SNOW","PLTR","SMCI","DELL","APP","SHOP","UBER","ABNB","NFLX","COIN","HOOD","PYPL","JPM","BAC","WFC","C","GS","MS","V","MA","AXP","SCHW","BLK","SPGI","CME","COF","UNH","JNJ","LLY","PFE","MRK","ABBV","TMO","ABT","AMGN","ISRG","MDT","BMY","GILD","CVS","WMT","COST","HD","MCD","NKE","SBUX","TGT","LOW","PG","KO","PEP","PM","MO","CL","EL","DIS","BKNG","MAR","CAT","DE","BA","GE","HON","UPS","RTX","LMT","XOM","CVX","COP","SLB","NEE","DUK","SO","F","T","VZ","CMCSA","TMUS","XAUUSD","XAGUSD"],"type":"string"},"time_frame":{"enum":[1,5,15,30,60,240,1440],"type":"number","description":"OHLCV timeframe in minutes: 1, 5, 15, 30, 60, 240, 1440."},"strategy_id":{"type":"string","minLength":1,"description":"Strategy id. Prefer always: routes to that Lab tab, and NO_ACTIVE_LAB errors include a direct Lab URL to open."}},"additionalProperties":false},"annotations":{"readOnlyHint":true}},"changes":[{"kind":"annotations","detail":"Added readOnlyHint: true (inferred from the name).","verify":true}],"tokensBefore":431,"tokensAfter":431},{"name":"list_backtests","fixed":{"name":"list_backtests","description":"Open Lab @B# rows with window, assets, trade count, PnL, win rate, drawdown, and tape_stripped.","inputSchema":{"type":"object","$schema":"http://json-schema.org/draft-07/schema#","properties":{"strategy_id":{"type":"string","minLength":1,"description":"Strategy id. Prefer always: routes to that Lab tab, and NO_ACTIVE_LAB errors include a direct Lab URL to open."},"iteration_ref":{"type":"string","maxLength":32,"minLength":1,"description":"Optional @R#. Omit to retrieve backtests across all iterations."}},"description":"@B# rows with window, PnL, trades, DD, tape_stripped.","additionalProperties":false},"annotations":{"readOnlyHint":true}},"changes":[{"kind":"annotations","detail":"Added readOnlyHint: true (inferred from the name).","verify":true}],"tokensBefore":181,"tokensAfter":181},{"name":"list_iterations","fixed":{"name":"list_iterations","description":"Open Lab @R# rows as the same dump as Live rules (parent, headline @B#, Long/Position/Exit).","inputSchema":{"type":"object","$schema":"http://json-schema.org/draft-07/schema#","properties":{"strategy_id":{"type":"string","minLength":1,"description":"Strategy id. Prefer always: routes to that Lab tab, and NO_ACTIVE_LAB errors include a direct Lab URL to open."}},"additionalProperties":false},"annotations":{"readOnlyHint":true}},"changes":[{"kind":"annotations","detail":"Added readOnlyHint: true (inferred from the name).","verify":true}],"tokensBefore":122,"tokensAfter":122},{"name":"list_strategies","fixed":{"name":"list_strategies","description":"Ids, @R# refs, and backtest headlines for strategies not currently open.","inputSchema":{"type":"object","$schema":"http://json-schema.org/draft-07/schema#","properties":{"limit":{"type":"integer","exclusiveMinimum":0},"offset":{"type":"integer","minimum":0},"strategy_id":{"type":"string","minLength":1,"description":"Strategy id. Prefer always: routes to that Lab tab, and NO_ACTIVE_LAB errors include a direct Lab URL to open."}},"additionalProperties":false},"annotations":{"readOnlyHint":true}},"changes":[{"kind":"annotations","detail":"Added readOnlyHint: true (inferred from the name).","verify":true}],"tokensBefore":140,"tokensAfter":140},{"name":"list_trades","fixed":{"name":"list_trades","description":"One page of fills (20 per page): trade_id, side, prices, PnL.","inputSchema":{"type":"object","$schema":"http://json-schema.org/draft-07/schema#","required":["ref","page","sort"],"properties":{"ref":{"type":"string","maxLength":128,"minLength":1,"description":"Backtest @B# ref (e.g. B3 or @B3)."},"page":{"type":"integer","minimum":1},"sort":{"enum":["open_date","pnl"],"type":"string"},"strategy_id":{"type":"string","minLength":1,"description":"Strategy id. Prefer always: routes to that Lab tab, and NO_ACTIVE_LAB errors include a direct Lab URL to open."}},"description":"One page of tape fills (20/page).","additionalProperties":false},"annotations":{"readOnlyHint":true}},"changes":[{"kind":"annotations","detail":"Added readOnlyHint: true (inferred from the name).","verify":true}],"tokensBefore":189,"tokensAfter":189},{"name":"patch_cooldown","fixed":{"name":"patch_cooldown","description":"Set root cooldownMinutes. Args: cooldownMinutes number|null. You are the DSL translator. Invent the section JSON (condition/position/exit/cooldown). Browser applies only — BenAwf does not call an LLM. No prose text.","inputSchema":{"type":"object","$schema":"http://json-schema.org/draft-07/schema#","required":["cooldownMinutes"],"properties":{"strategy_id":{"type":"string","minLength":1,"description":"Strategy id. Prefer always: routes to that Lab tab, and NO_ACTIVE_LAB errors include a direct Lab URL to open."},"cooldownMinutes":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Root cooldownMinutes, or null to clear."}},"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false}},"changes":[{"kind":"annotations","detail":"Added readOnlyHint: false, destructiveHint: false, idempotentHint: false (inferred from the name).","verify":true}],"tokensBefore":203,"tokensAfter":203},{"name":"patch_entry_gate","fixed":{"name":"patch_entry_gate","description":"Replace one entry gate by id. Args: id + condition JSON. You are the DSL translator. Invent the section JSON (condition/position/exit/cooldown). Browser applies only — BenAwf does not call an LLM. No prose text.","inputSchema":{"type":"object","$schema":"http://json-schema.org/draft-07/schema#","required":["id","condition"],"properties":{"id":{"type":"string","maxLength":32,"minLength":1,"description":"Gate id from get_experiment.rules.entry."},"condition":{"anyOf":[{"type":"object","required":["kind","left","op","right"],"properties":{"op":{"enum":["gt","lt","gte","lte","crosses_above","crosses_below"],"type":"string","description":"Comparison operator. crosses_above/crosses_below require previous bar context."},"kind":{"type":"string","const":"comparison"},"left":{"anyOf":[{"type":"object","required":["kind","field","timeframeMinutes","lookback"],"properties":{"kind":{"type":"string","const":"price"},"field":{"enum":["open","high","low","close"],"type":"string","description":"Bar field: open, high, low, or close (default close). Ignored at `lookback: 0` (live ticker). At `lookback >= 1` returns this OHLC field of bar N back — enables wick/rejection patterns (e.g. high pierced a level then close reclaimed)."},"lookback":{"type":"integer","maximum":20,"minimum":0,"description":"How many bars back to look. 0 = latest bar, 1 = one bar ago, etc. Max 20."},"timeframeMinutes":{"type":"integer","description":"Chart timeframe (5, 15, 60, 240, or 1440 minutes) the lookback resolves against. `lookback: 0` returns the live ticker price (timeframe-independent); `lookback >= 1` returns the chosen `field` of bar N back on this timeframe."}},"additionalProperties":false},{"type":"object","required":["kind","value"],"properties":{"kind":{"type":"string","const":"constant"},"value":{"type":"number"}},"additionalProperties":false},{"type":"object","required":["kind","name","field","timeframeMinutes","lookback","params"],"properties":{"kind":{"type":"string","const":"indicator"},"name":{"type":"string","description":"Indicator name. One of: SMA20, SMA50, EMA, RSI, ADX, MACD, BBANDS, ATR, ATR_PCT, VWAP, OBV, OBV_CHANGE, LAST_DAY_HIGH, LAST_DAY_LOW, LAST_WEEK_HIGH, LAST_WEEK_LOW, SWING_HIGH, SWING_LOW, BOS, CHOCH, DISPLACEMENT, VOLUME_PROFILE, DEALING_RANGE."},"field":{"enum":["value","signal","histogram","upper","middle","lower","poc","vah","val","equilibrium","premium_pct"],"type":"string","description":"Sub-field for composite indicators: MACD uses signal/histogram, BBANDS uses upper/middle/lower, VOLUME_PROFILE uses poc/vah/val, DEALING_RANGE uses equilibrium/premium_pct. Use value for scalar indicators."},"params":{"type":"object","required":["wing","atrMult","lookbackBars"],"properties":{"wing":{"anyOf":[{"type":"integer","maximum":10,"minimum":1},{"type":"null"}],"description":"Pivot wing for SWING_HIGH/SWING_LOW/BOS/CHOCH/DEALING_RANGE: bars required on each side to confirm a pivot. Default 3. Smaller (1–2) = short-term structure, larger (4–10) = major swings only."},"atrMult":{"anyOf":[{"type":"number","maximum":5,"minimum":0.5},{"type":"null"}],"description":"ATR(14) multiplier for DISPLACEMENT: bar range must exceed atrMult × ATR to count as displacement. Default 1.5."},"lookbackBars":{"anyOf":[{"type":"integer","maximum":100,"minimum":10},{"type":"null"}],"description":"Rolling window length for VOLUME_PROFILE (bars ending at the current closed bar). Default 48. Must fit the entry-rules indicator window (≤100)."}},"description":"Optional indicator parameters (e.g. swing pivot wing, VOLUME_PROFILE lookbackBars). Empty object = defaults.","additionalProperties":false},"lookback":{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/0/properties/lookback"},"timeframeMinutes":{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/0/properties/timeframeMinutes","description":"Chart timeframe: 5, 15, 60, 240 (4h), or 1440 (daily) minutes."}},"additionalProperties":false},{"type":"object","required":["kind","zoneType","state","field","timeframeMinutes","lookback"],"properties":{"kind":{"type":"string","const":"zone"},"field":{"enum":["top","bottom","mid"],"type":"string","description":"Zone price level: top or bottom edge, or mid (midpoint — the FVG 'consequent encroachment'). Default mid."},"state":{"enum":["open","tapped","mitigated"],"type":"string","description":"Which zones to consider: open = untouched, tapped = wick entered but no close through, mitigated = closed beyond the far edge. Default open."},"lookback":{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/0/properties/lookback"},"zoneType":{"enum":["fvg_bull","fvg_bear","ob_bull","ob_bear"],"type":"string","description":"fvg_bull/fvg_bear = 3-candle fair value gap (imbalance). ob_bull/ob_bear = last opposite-close candle before a displacement bar (order block)."},"timeframeMinutes":{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/0/properties/timeframeMinutes","description":"Chart timeframe the zone detection runs on: 5, 15, 60, 240 (4h), or 1440 (daily) minutes."}},"additionalProperties":false},{"type":"object","required":["kind","fn","a","b"],"properties":{"a":{"anyOf":[{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/0"},{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/1"},{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/2"},{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/3"}],"description":"First input — a primitive operand (price, indicator, or constant). No nesting."},"b":{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/4/properties/a","description":"Second input — a primitive operand (price, indicator, or constant). No nesting."},"fn":{"enum":["spread","ratio","abs_distance_pct"],"type":"string","description":"spread = a - b (same units as inputs). ratio = a / b (fails when b is 0). abs_distance_pct = |a - b| / |b| * 100 (percent points — same scale as ATR_PCT and SL/TP)."},"kind":{"type":"string","const":"derived"}},"additionalProperties":false}]},"right":{"$ref":"#/properties/condition/anyOf/0/properties/left"}},"additionalProperties":false},{"type":"object","required":["kind","startUtc","endUtc","timeframeMinutes"],"properties":{"kind":{"type":"string","const":"time_window"},"endUtc":{"$ref":"#/properties/condition/anyOf/1/properties/startUtc","description":"Window end, exclusive. Earlier than startUtc = overnight window (e.g. \"02:00\" with start \"22:00\"). Equal to startUtc = always in window."},"startUtc":{"type":"string","description":"Window start, inclusive (e.g. \"09:30\" for the New York killzone open)."},"timeframeMinutes":{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/0/properties/timeframeMinutes","description":"Chart timeframe whose latest closed bar provides the clock. Use 5 or 15 for killzone precision."}},"additionalProperties":false},{"type":"object","required":["kind","days","timeframeMinutes"],"properties":{"days":{"type":"array","items":{"enum":["sun","mon","tue","wed","thu","fri","sat"],"type":"string"},"maxItems":7,"minItems":1,"description":"Allowed UTC weekdays (e.g. omit \"fri\" to skip Friday)."},"kind":{"type":"string","const":"day_of_week"},"timeframeMinutes":{"$ref":"#/properties/condition/anyOf/0/properties/left/anyOf/0/properties/timeframeMinutes","description":"Chart timeframe whose latest closed bar provides the clock. Use 5 or 15 for precision."}},"additionalProperties":false}],"description":"Translator-shaped replacement condition."},"strategy_id":{"type":"string","minLength":1,"description":"Strategy id. Prefer always: routes to that Lab tab, and NO_ACTIVE_LAB errors include a direct Lab URL to open."}},"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false}},"changes":[{"kind":"annotations","detail":"Added readOnlyHint: false, destructiveHint: false, idempotentHint: false (inferred from the name).","verify":true}],"tokensBefore":2148,"tokensAfter":2148},{"name":"patch_exit","fixed":{"name":"patch_exit","description":"Full replace of rules.exit. Args: exit JSON. You are the DSL translator. Invent the section JSON (condition/position/exit/cooldown). Browser applies only — BenAwf does not call an LLM. No prose text.","inputSchema":{"type":"object","$schema":"http://json-schema.org/draft-07/schema#","required":["exit"],"properties":{"exit":{"type":"object","required":["stopLossPercentage","takeProfitPercentage","partialExitsAt","trail","breakevenAfterMinutes","maxHoldMinutes","signalExit"],"properties":{"trail":{"anyOf":[{"type":"array","items":{"type":"number"},"maxItems":2,"minItems":2},{"type":"null"}],"description":"Trail config: [fire, extend]. Null disables. extend > 0 chains (re-arm after each bump); extend = 0 locks SL at the fire price once then clears. fire = fraction of current TP distance (0–1 exclusive); extend = TP multiplier add-on (0 = fire-price lock one-shot)."},"signalExit":{"anyOf":[{"type":"object","required":["long","short"],"properties":{"long":{"type":"array","items":{"anyOf":[{"type":"object","required":["kind","left","op","right"],"properties":{"op":{"enum":["gt","lt","gte","lte","crosses_above","crosses_below"],"type":"string","description":"Comparison operator. crosses_above/crosses_below require previous bar context."},"kind":{"type":"string","const":"comparison"},"left":{"$ref":"#/properties/exit/properties/stopLossPercentage/anyOf/1/properties/source"},"right":{"$ref":"#/properties/exit/properties/signalExit/anyOf/0/properties/long/items/anyOf/0/properties/left"}},"additionalProperties":false},{"type":"object","required":["kind","startUtc","endUtc","timeframeMinutes"],"properties":{"kind":{"type":"string","const":"time_window"},"endUtc":{"$ref":"#/properties/exit/properties/signalExit/anyOf/0/properties/long/items/anyOf/1/properties/startUtc","description":"Window end, exclusive. Earlier than startUtc = overnight window (e.g. \"02:00\" with start \"22:00\"). Equal to startUtc = always in window."},"startUtc":{"type":"string","description":"Window start, inclusive (e.g. \"09:30\" for the New York killzone open)."},"timeframeMinutes":{"$ref":"#/properties/exit/properties/stopLossPercentage/anyOf/1/properties/source/anyOf/0/properties/timeframeMinutes","description":"Chart timeframe whose latest closed bar provides the clock. Use 5 or 15 for killzone precision."}},"additionalProperties":false},{"type":"object","required":["kind","days","timeframeMinutes"],"properties":{"days":{"type":"array","items":{"enum":["sun","mon","tue","wed","thu","fri","sat"],"type":"string"},"maxItems":7,"minItems":1,"description":"Allowed UTC weekdays (e.g. omit \"fri\" to skip Friday)."},"kind":{"type":"string","const":"day_of_week"},"timeframeMinutes":{"$ref":"#/properties/exit/properties/stopLossPercentage/anyOf/1/properties/source/anyOf/0/properties/timeframeMinutes","description":"Chart timeframe whose latest closed bar provides the clock. Use 5 or 15 for precision."}},"additionalProperties":false}]}},"short":{"type":"array","items":{"$ref":"#/properties/exit/properties/signalExit/anyOf/0/properties/long/items"}}},"additionalProperties":false},{"type":"null"}],"description":"Optional indicator-based exit: closes the position at market when these conditions fire (evaluated on the same cadence as entries). Same condition shape as entry blocks. Use for mean-reversion targets (e.g. close crosses VWAP) or thesis-invalidation exits instead of relying only on fixed TP. Null disables."},"maxHoldMinutes":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Hard TTL: force close at market after this many minutes regardless of PnL. Null disables."},"partialExitsAt":{"anyOf":[{"type":"array","items":{"type":"object","required":["pricePercentage","exitAmountFraction"],"properties":{"pricePercentage":{"type":"number","description":"Signed decimal move from entry (-1 to 1). Percent as fraction: -0.005 = -0.5%, 0.03 = +3%. Not the 0–100 scale used by stopLossPercentage.","exclusiveMaximum":1,"exclusiveMinimum":-1},"exitAmountFraction":{"type":"number","description":"Fraction of the remaining position to liquidate when this level is hit","exclusiveMaximum":1,"exclusiveMinimum":0}},"additionalProperties":false}},{"type":"null"}],"description":"Ladder of partial exits. Null means no partial exits."},"stopLossPercentage":{"anyOf":[{"type":"number","maximum":100,"minimum":0,"description":"Fixed stop/TP distance on the 0–100 scale (original shape)."},{"type":"object","required":["source","op","value","minPercentage","maxPercentage","fallbackPercentage"],"properties":{"op":{"enum":["multiply","add"],"type":"string","description":"multiply = resolved(source) × value; add = resolved(source) + value."},"value":{"type":"number","description":"Multiplier or addend applied after resolving source."},"source":{"anyOf":[{"type":"object","required":["kind","field","timeframeMinutes","lookback"],"properties":{"kind":{"type":"string","const":"price"},"field":{"enum":["open","high","low","close"],"type":"string","description":"Bar field: open, high, low, or close (default close). Ignored at `lookback: 0` (live ticker). At `lookback >= 1` returns this OHLC field of bar N back — enables wick/rejection patterns (e.g. high pierced a level then close reclaimed)."},"lookback":{"type":"integer","maximum":20,"minimum":0,"description":"How many bars back to look. 0 = latest bar, 1 = one bar ago, etc. Max 20."},"timeframeMinutes":{"type":"integer","description":"Chart timeframe (5, 15, 60, 240, or 1440 minutes) the lookback resolves against. `lookback: 0` returns the live ticker price (timeframe-independent); `lookback >= 1` returns the chosen `field` of bar N back on this timeframe."}},"additionalProperties":false},{"type":"object","required":["kind","value"],"properties":{"kind":{"type":"string","const":"constant"},"value":{"type":"number"}},"additionalProperties":false},{"type":"object","required":["kind","name","field","timeframeMinutes","lookback","params"],"properties":{"kind":{"type":"string","const":"indicator"},"name":{"type":"string","description":"Indicator name. One of: SMA20, SMA50, EMA, RSI, ADX, MACD, BBANDS, ATR, ATR_PCT, VWAP, OBV, OBV_CHANGE, LAST_DAY_HIGH, LAST_DAY_LOW, LAST_WEEK_HIGH, LAST_WEEK_LOW, SWING_HIGH, SWING_LOW, BOS, CHOCH, DISPLACEMENT, VOLUME_PROFILE, DEALING_RANGE."},"field":{"enum":["value","signal","histogram","upper","middle","lower","poc","vah","val","equilibrium","premium_pct"],"type":"string","description":"Sub-field for composite indicators: MACD uses signal/histogram, BBANDS uses upper/middle/lower, VOLUME_PROFILE uses poc/vah/val, DEALING_RANGE uses equilibrium/premium_pct. Use value for scalar indicators."},"params":{"type":"object","required":["wing","atrMult","lookbackBars"],"properties":{"wing":{"anyOf":[{"type":"integer","maximum":10,"minimum":1},{"type":"null"}],"description":"Pivot wing for SWING_HIGH/SWING_LOW/BOS/CHOCH/DEALING_RANGE: bars required on each side to confirm a pivot. Default 3. Smaller (1–2) = short-term structure, larger (4–10) = major swings only."},"atrMult":{"anyOf":[{"type":"number","maximum":5,"minimum":0.5},{"type":"null"}],"description":"ATR(14) multiplier for DISPLACEMENT: bar range must exceed atrMult × ATR to count as displacement. Default 1.5."},"lookbackBars":{"anyOf":[{"type":"integer","maximum":100,"minimum":10},{"type":"null"}],"description":"Rolling window length for VOLUME_PROFILE (bars ending at the current closed bar). Default 48. Must fit the entry-rules indicator window (≤100)."}},"description":"Optional indicator parameters (e.g. swing pivot wing, VOLUME_PROFILE lookbackBars). Empty object = defaults.","additionalProperties":false},"lookback":{"$ref":"#/properties/exit/properties/stopLossPercentage/anyOf/1/properties/source/anyOf/0/properties/lookback"},"timeframeMinutes":{"$ref":"#/properties/exit/properties/stopLossPercentage/anyOf/1/properties/source/anyOf/0/properties/timeframeMinutes","description":"Chart timeframe: 5, 15, 60, 240 (4h), or 1440 (daily) minutes."}},"additionalProperties":false},{"type":"object","required":["kind","zoneType","state","field","timeframeMinutes","lookback"],"properties":{"kind":{"type":"string","const":"zone"},"field":{"enum":["top","bottom","mid"],"type":"string","description":"Zone price level: top or bottom edge, or mid (midpoint — the FVG 'consequent encroachment'). Default mid."},"state":{"enum":["open","tapped","mitigated"],"type":"string","description":"Which zones to consider: open = untouched, tapped = wick entered but no close through, mitigated = closed beyond the far edge. Default open."},"lookback":{"$ref":"#/properties/exit/properties/stopLossPercentage/anyOf/1/properties/source/anyOf/0/properties/lookback"},"zoneType":{"enum":["fvg_bull","fvg_bear","ob_bull","ob_bear"],"type":"string","description":"fvg_bull/fvg_bear = 3-candle fair value gap (imbalance). ob_bull/ob_bear = last opposite-close candle before a displacement bar (order block)."},"timeframeMinutes":{"$ref":"#/properties/exit/properties/stopLossPercentage/anyOf/1/properties/source/anyOf/0/properties/timeframeMinutes","description":"Chart timeframe the zone detection runs on: 5, 15, 60, 240 (4h), or 1440 (daily) minutes."}},"additionalProperties":false},{"type":"object","required":["kind","fn","a","b"],"properties":{"a":{"anyOf":[{"$ref":"#/properties/exit/properties/stopLossPercentage/anyOf/1/properties/source/anyOf/0"},{"$ref":"#/properties/exit/properties/stopLossPercentage/anyOf/1/properties/source/anyOf/1"},{"$ref":"#/properties/exit/properties/stopLossPercentage/anyOf/1/properties/source/anyOf/2"},{"$ref":"#/properties/exit/properties/stopLossPercentage/anyOf/1/properties/source/anyOf/3"}],"description":"First input — a primitive operand (price, indicator, or constant). No nesting."},"b":{"$ref":"#/properties/exit/properties/stopLossPercentage/anyOf/1/properties/source/anyOf/4/properties/a","description":"Second input — a primitive operand (price, indicator, or constant). No nesting."},"fn":{"enum":["spread","ratio","abs_distance_pct"],"type":"string","description":"spread = a - b (same units as inputs). ratio = a / b (fails when b is 0). abs_distance_pct = |a - b| / |b| * 100 (percent points — same scale as ATR_PCT and SL/TP)."},"kind":{"type":"string","const":"derived"}},"additionalProperties":false}],"description":"Operand resolved at rule-fire time (latest fully closed bar). Any indicator, price field, or derived expression."},"maxPercentage":{"anyOf":[{"type":"number","maximum":100,"minimum":0},{"type":"null"}],"description":"Ceiling on the resolved 0–100 distance after op. Null disables."},"minPercentage":{"anyOf":[{"type":"number","maximum":100,"minimum":0},{"type":"null"}],"description":"Floor on the resolved 0–100 distance after op. Null disables."},"fallbackPercentage":{"type":"number","maximum":100,"minimum":0,"description":"Fixed 0–100 distance used when source resolves null (indicator warmup)."}},"additionalProperties":false}],"description":"Stop-loss distance from entry on the 0–100 scale, or a dynamic expression resolved at fire time. 0 disables SL."},"takeProfitPercentage":{"anyOf":[{"$ref":"#/properties/exit/properties/stopLossPercentage/anyOf/0"},{"$ref":"#/properties/exit/properties/stopLossPercentage/anyOf/1"}],"description":"Take-profit distance from entry on the 0–100 scale, or a dynamic expression resolved at fire time."},"breakevenAfterMinutes":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Soft TTL: minutes after open at which the engine intervenes. If the trade is in profit, it closes at market to lock in the gain. If underwater, SL moves to break-even. Null disables."}},"description":"Full replace of rules.exit (not a merge). Every key required — null disables: stopLossPercentage + takeProfitPercentage = 0–100 number OR {source,op,value,fallbackPercentage,minPercentage,maxPercentage}; partialExitsAt = [{pricePercentage, exitAmountFraction}] | null (pricePercentage is a decimal fraction: 0.03 = +3%, NOT the 0–100 SL/TP scale); trail = [fire, extend] | null (fire in (0,1), extend >= 0; NOT {fire,extend}); breakevenAfterMinutes + maxHoldMinutes = number | null; signalExit = {long, short} condition arrays | null. Cooldown lives on the rules root (op=patch_cooldown), not here.","additionalProperties":false},"strategy_id":{"type":"string","minLength":1,"description":"Strategy id. Prefer always: routes to that Lab tab, and NO_ACTIVE_LAB errors include a direct Lab URL to open."}},"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false}},"changes":[{"kind":"annotations","detail":"Added readOnlyHint: false, destructiveHint: false, idempotentHint: false (inferred from the name).","verify":true}],"tokensBefore":3476,"tokensAfter":3476},{"name":"patch_position","fixed":{"name":"patch_position","description":"Full replace of rules.position. Args: position JSON. You are the DSL translator. Invent the section JSON (condition/position/exit/cooldown). Browser applies only — BenAwf does not call an LLM. No prose text.","inputSchema":{"type":"object","$schema":"http://json-schema.org/draft-07/schema#","required":["position"],"properties":{"position":{"type":"object","required":["usdAmount","balancePercent","orderType","limitPrice","expiresInMinutes","usedTechnicalAnalysisIndicators"],"properties":{"orderType":{"enum":["market","limit"],"type":"string"},"usdAmount":{"type":"number","minimum":0,"description":"Fixed USD notional when the rule fires. Use 0 when sizing via balancePercent."},"limitPrice":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Limit price when orderType is limit; null for market orders."},"balancePercent":{"type":"number","maximum":100,"minimum":0,"description":"Percent of available balance to deploy (0–100 scale) when the rule fires. Use 0 when sizing via usdAmount."},"expiresInMinutes":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Limit order TTL in minutes; null when not used."},"usedTechnicalAnalysisIndicators":{"type":"array","items":{"type":"string"},"description":"Indicators that justify this entry (one of: SMA20, SMA50, EMA, RSI, ADX, MACD, BBANDS, ATR, ATR_PCT, VWAP, OBV, OBV_CHANGE, LAST_DAY_HIGH, LAST_DAY_LOW, LAST_WEEK_HIGH, LAST_WEEK_LOW, SWING_HIGH, SWING_LOW, BOS, CHOCH, DISPLACEMENT, VOLUME_PROFILE, DEALING_RANGE) — use [] when none. Never list zone types (fvg_bull, fvg_bear, ob_bull, ob_bear); those belong on zone operands."}},"description":"Full replace of rules.position (not a merge). Every key required. usdAmount XOR balancePercent (unused = 0). orderType = market|limit. limitPrice + expiresInMinutes = number | null (null unless limit). usedTechnicalAnalysisIndicators = string[] ([] if none; never zone types).","additionalProperties":false},"strategy_id":{"type":"string","minLength":1,"description":"Strategy id. Prefer always: routes to that Lab tab, and NO_ACTIVE_LAB errors include a direct Lab URL to open."}},"additionalProperties":false},"annotations":{"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false}},"changes":[{"kind":"annotations","detail":"Added readOnlyHint: false, destructiveHint: false, idempotentHint: false (inferred from the name).","verify":true}],"tokensBefore":615,"tokensAfter":615}],"toolsChanged":14,"tokensSaved":0,"todo":[{"tool":"get_market_context_by_date","params":["date","symbol"]},{"tool":"list_strategies","params":["limit","offset"]},{"tool":"list_trades","params":["page","sort"]}],"note":"Deterministic fixes. Changes marked verify need a human look before shipping (renames, inferred annotations, inferred types, removed text). Parameter descriptions in `todo` need to be written by someone who knows the API."}