[CAUTION] Stop a grid bot or close its remaining open position — real trades, irreversible. Workflow: (1) If the user has not specified which bot to stop, call grid_get_orders first and ask the user to confirm which bot before proceeding. (2) Call grid_get_order_details to check the current 'stat...
AI agents use grid_stop_order to commit financial operations through Okx Trade — usually the final step of a payment, billing, or trading workflow. A call moves real money.
| Parameter | Type | Required | Description |
|---|---|---|---|
algoId | string | Yes | Grid bot algo order ID (not a trade ordId) |
instId | string | Yes | Instrument ID, e.g. BTC-USDT, BTC-USDT-SWAP |
stopType | string | — | '1' (default): stop strategy and sell - spot grid sells all base assets back to quote; contract grid market-closes all positions. '2': stop strategy without sel |
algoOrdType | string | Yes | grid=Spot grid, contract_grid=Contract grid |
Parameters from the server's own tool schema.
This tool executes real financial trades on OKX exchange, closing positions and selling assets. It is explicitly marked as irreversible and involves moving real financial assets, placing it in the Financial category with critical severity due to the potential for significant monetary loss if misused.
From the tool's definition Stop a grid bot or close its remaining open position — real trades, irreversible. spot grid sells all base assets back to quote; contract grid market-closes all positions
Attacks that exploit this kind of access
[CAUTION] Stop a grid bot or close its remaining open position — real trades, irreversible. Workflow: (1) If the user has not specified which bot to stop, call grid_get_orders first and ask the user to confirm which bot before proceeding. (2) Call grid_get_order_details to check the current 'state' field. (3) If state='running' → call this tool: stopType='1' (default, clean exit) — spot grid sells all base assets back to quote; contract grid market-closes all positions. stopType='2' (keep assets) — spot grid keeps base assets as-is; contract grid cancels grid orders but leaves the position open. (4) If state='no_close_position' → call this tool with stopType='1' to close the remaining open position. It is categorised as a Financial tool in the Okx Trade MCP Server, which means it involves financial transactions. Block by default and require explicit approval.
grid_stop_order accepts 4 parameters: algoId, instId, stopType, algoOrdType. Required: algoId, instId, algoOrdType. The full parameter table on this page comes from the server's own tool schema.
Register the Okx Trade MCP server in PolicyLayer and add a rule for grid_stop_order: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Okx Trade. Nothing to install.
grid_stop_order is a Financial tool with critical risk. Critical-risk tools should be blocked by default and only enabled with explicit human approval.
Yes. Add a rate_limit block to the grid_stop_order rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for grid_stop_order. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
grid_stop_order is provided by the Okx Trade MCP server (@okx_ai/okx-trade-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
Every MCP server has a record like this.
Type a name, get the same breakdown: verified identity, auth posture, risk grade, capabilities, recommended policy.
Teams ship this data inside their own products. See what a licence covers →