Edit Grid Bot (MCP Tool)
Description
Based on: /docs/rest-api/patch-grid-bot-edit
Edit a Grid Bot by code. Send the complete settings payload required by the cabinet form. Check the REST API reference for conditional settings and field rules. This tool runs on WunderTrading.
For grid spacing, use gridPercentStep: 1% Profit per grid in the cabinet is 0.01 in the request.
The server refreshes the pair price and calculates the nearest levels and level count before validating the edit.
Required permission: grid_bot:write.
Prompt example
Edit my Grid Bot with code bot-code. Ask me to confirm the full settings.
Input Schema
{
"type": "object",
"description": "Complete Grid Bot settings, as required by the REST API. On edit, provide the full settings payload, not only changed fields. Match cabinet labels to the API fields described below; do not send UI-only names. ",
"properties": {
"code": {
"type": "string",
"minLength": 1,
"description": "Code that identifies the bot, available in bot list results."
},
"name": {
"type": "string",
"example": "My Grid Bot",
"description": "Bot name in the UI."
},
"exchangeCode": {
"type": "string",
"description": "Exchange selected in the UI.",
"example": "BINANCE"
},
"pairCode": {
"type": "string",
"example": "BTCUSDT",
"description": "Trading pair selected in the UI."
},
"profilesCodes": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"description": "One API profile code."
},
"example": [
"my-profile-code"
],
"description": "Exchange account selected in the UI."
},
"gridMarket": {
"type": "string",
"enum": [
"spot",
"derivative"
],
"description": "Market of the selected exchange account. MCP sends this as the gridMarket query parameter."
},
"gridType": {
"type": "string",
"enum": [
"interval",
"infinite"
],
"description": "Grid Size in the UI: Interval = interval; Infinite = infinite. Spot always uses interval."
},
"gridMethod": {
"type": "string",
"enum": [
"classic",
"two_way"
],
"description": "Derived from the UI Grid Type: Long, Short and Neutral use classic; Two-way uses two_way."
},
"gridTradingType": {
"type": "string",
"enum": [
"long",
"short",
"neutral",
"two_way"
],
"description": "Grid Type selected in the UI: Long, Short, Neutral or Two-way."
},
"midPrice": {
"type": "number",
"minimum": 0,
"description": "Grid middle price. Interval Long uses highPrice, Short lowPrice, Neutral the midpoint of highPrice/lowPrice. Infinite Long uses 10000000000, Short uses 0 as a sentinel, Neutral uses current last price. Two-way uses the selected middle price. Do not send 0 as a generic missing value."
},
"highPrice": {
"type": [
"number",
"null"
],
"exclusiveMinimum": 0,
"description": "Higher price in the UI for Interval grids."
},
"lowPrice": {
"type": [
"number",
"null"
],
"exclusiveMinimum": 0,
"description": "Lower price in the UI for Interval grids."
},
"gridPercentStep": {
"type": "number",
"exclusiveMinimum": 0,
"description": "Profit per grid in the UI, as a fraction (1% = 0.01). Open API combines this with the current server price to calculate the nearest grid levels and their count."
},
"investmentBase": {
"type": [
"number",
"null"
],
"minimum": 0,
"description": "Conventional quote-asset amount allocated to the spot grid (USDT in BTC/USDT)."
},
"investmentRef": {
"type": [
"number",
"null"
],
"minimum": 0,
"description": "Conventional base-asset amount allocated to the spot grid (BTC in BTC/USDT)."
},
"amountPerTrade": {
"type": "number",
"exclusiveMinimum": 0,
"description": "Amount per trade; if the UI unit is %, send a fraction."
},
"amountPerTradeType": {
"type": "string",
"enum": [
"base",
"quote",
"percents"
],
"description": "API amount unit: base is BTC and quote is USDT in BTC/USDT. The cabinet UI uses different internal values."
},
"amountPerTradeMultiplier": {
"type": [
"number",
"null"
],
"minimum": 1,
"maximum": 125,
"description": "Order amount multiplier on derivative exchanges."
},
"leverage": {
"type": [
"number",
"null"
],
"minimum": 1,
"maximum": 125,
"description": "Leverage configured for the bot."
},
"exchangeLeverage": {
"type": [
"number",
"null"
],
"minimum": 1,
"maximum": 125,
"description": "Leverage setting applied on the exchange."
},
"signalCode": {
"type": [
"string",
"null"
],
"description": "Existing webhook signal code to retain when editing; keep it secret."
},
"startCondition": {
"type": "string",
"enum": [
"immediate",
"indicator",
"webhook_alert"
],
"description": "Bot start condition in the UI."
},
"signalSource": {
"type": [
"string",
"null"
],
"description": "Webhook alert source when Bot start condition is Webhook Alert. Call get_grid_bot_alerts for the exact external webhook URL and start/stop JSON bodies."
},
"stopCondition": {
"type": "string",
"enum": [
"stop_only",
"stop_and_close_all",
"stop_and_close_all_and_convert_to_profit_currency"
],
"description": "Stop condition: Stop only, Stop and close all, or Stop and close all and convert to profit currency."
},
"profitCurrencyType": {
"type": "string",
"enum": [
"base",
"quote"
],
"description": "API profit currency: base is BTC and quote is USDT in BTC/USDT. The cabinet UI uses different internal values; derivatives use quote."
},
"takeProfit": {
"type": [
"number",
"null"
],
"exclusiveMinimum": 0,
"description": "Always an absolute USD ($) amount, including spot pairs quoted in another currency. Stops the bot when total PnL reaches this profit; 10 means $10, not 10%."
},
"takeProfitOrderType": {
"type": "string",
"enum": [
"market",
"best_bid_ask_limit"
],
"description": "Order type used when taking profit."
},
"takeProfitOrderTypeSettings": {
"type": [
"object",
"null"
],
"description": "Settings for best_bid_ask_limit take-profit orders.",
"properties": {
"postOnly": {
"type": "boolean",
"description": "Place the take-profit limit order without taking existing liquidity."
}
}
},
"stopLoss": {
"type": [
"number",
"null"
],
"exclusiveMinimum": 0,
"description": "Always an absolute USD ($) amount, including spot pairs quoted in another currency. Stops the bot when selected PnL reaches this loss; 10 means a loss of $10."
},
"stopLossPnlCompareType": {
"type": "string",
"enum": [
"total",
"unrealized"
],
"default": "total",
"description": "Stop loss Based on selector: Total = total; Unrealized = unrealized."
},
"trailingStopActivation": {
"type": [
"number",
"null"
],
"exclusiveMinimum": 0,
"description": "Always an absolute USD ($) amount. The selected PnL must reach this peak before bot-level trailing stop activates."
},
"trailingStopExecute": {
"type": [
"number",
"null"
],
"exclusiveMinimum": 0,
"description": "Always an absolute USD ($) amount. Bot-level trailing stop triggers after the selected PnL drops this far from its peak."
},
"trailingStopPnlCompareType": {
"type": "string",
"enum": [
"total",
"unrealized"
],
"default": "total",
"description": "Trailing stop Based on selector: Total = total; Unrealized = unrealized."
},
"strategyProfitCondition": {
"type": "string",
"enum": [
"take_profit",
"trailing_stop"
],
"default": "take_profit",
"description": "Positions trailing stop switch: on = trailing_stop; off = take_profit."
},
"strategyStopLossFixedPercentRatio": {
"type": [
"number",
"null"
],
"exclusiveMinimum": 0,
"description": "Positions stop loss target, as a fraction (2% in the UI = 0.02)."
},
"stopOnOutOfGrid": {
"type": "boolean",
"default": false,
"description": "Stop trigger / stop on out of grid switch."
},
"pumpProtection": {
"type": "boolean",
"default": false,
"description": "Classic grid: market entries instead of resting limits. Two-way grid: a crossing from below can enter Long only; from above, Short only. This does not guarantee protection from a pump or dump."
},
"pumpProtectionOrderType": {
"type": "string",
"enum": [
"market",
"limit"
],
"default": "market",
"description": "Market or limit for two-way pump-protected entries; classic pumpProtection itself uses market entries."
},
"maxRequiredAmount": {
"type": [
"string",
"null"
],
"description": "Client-side required-amount estimate stored with the bot."
},
"indicators": {
"type": [
"object",
"null"
],
"description": "Selected start indicator and its settings when Bot start condition is Indicator.",
"properties": {
"rsi": {
"type": "object",
"properties": {
"period": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"description": "Candle period used to calculate RSI."
},
"rsiValue": {
"type": [
"number",
"null"
],
"minimum": 0.01,
"maximum": 100,
"description": "RSI threshold that starts the bot."
}
},
"description": "RSI settings for indicator start."
},
"macd": {
"type": "object",
"properties": {
"fastPeriod": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"description": "Fast moving-average period for MACD."
},
"slowPeriod": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"description": "Slow moving-average period for MACD."
},
"signalPeriod": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"description": "Signal-line period for MACD."
}
},
"description": "MACD settings for indicator start."
},
"bb": {
"type": "object",
"properties": {
"period": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"description": "Candle period used to calculate Bollinger Bands."
},
"stdDev": {
"type": "number",
"minimum": 0.001,
"maximum": 50,
"description": "Standard-deviation multiplier for Bollinger Bands."
}
},
"description": "Bollinger Bands settings for indicator start."
},
"price_change": {
"type": "object",
"properties": {
"priceDeviation": {
"type": "number",
"minimum": 0.005,
"maximum": 0.1,
"description": "Price change that starts the bot, as a fraction."
}
},
"description": "Price-change settings for indicator start."
}
}
}
},
"required": [
"code",
"name",
"exchangeCode",
"pairCode",
"profilesCodes",
"gridType",
"gridMethod",
"gridMarket",
"gridTradingType",
"gridPercentStep",
"midPrice",
"amountPerTrade",
"amountPerTradeType",
"profitCurrencyType",
"stopCondition"
],
"additionalProperties": true
}