Skip to main content
Glama

set_stop

Destructive

Tightens an open perpetual position's stop-loss toward the mark to lock in gains or cut risk, replacing the old stop only after the new one is accepted.

Instructions

LIVE MONEY: acts on the real account. Move an open position's stop-loss tighter, toward the mark, to lock in gains or cut risk; never wider. One stop for the whole position goes on first, then every older stop on the coin is cancelled, so the position is never unprotected and a refused new order leaves the old one in place. Refused: no open position, a stop past the mark (it would fire at once), or a stop wider than or equal to the current one (a long's new stop must be above it, a short's below). With no stop at all, any stop on the right side of the mark is placed. Never changes the target or the size. To widen a stop, close and re-enter with place_bracket; to move the target use set_target; to fold duplicate stops left by several fills use sweep_brackets. Needs a trading key. Returns {ok, stop_px, size, mark, replaced: old stop prices}; a refusal is {ok: false, reason, mark, current_stop} with isError true and nothing sent.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "coin": "<coin>",
      "stop_px": "<stop_px>"
    },
    "name": "set_stop"
  }
}

Input Schema

NameRequiredDescriptionDefault
coinYesCoin: a main-dex perp by name (BTC, ETH) or a HIP-3 perp as dex:SYMBOL (xyz:GOLD, xyz:BRENTOIL).
stop_pxYesNew stop: above the current stop for a long, below it for a short, and on the safe side of the mark.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.6.1

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations supply only destructiveHint=true, so the description carries the burden and does: it discloses live-account risk, the protective ordering (new stop placed first, then old stops cancelled, so a refusal leaves the old stop in place), and the exact refusal conditions. It also states the return payload and that refusals come back with isError true and nothing sent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded with the money-at-risk warning and every clause is information-bearing, but the single dense paragraph packs refusal rules, ordering, alternatives, and return shape together, which makes it heavier to parse than a short structured list would be.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, yet the description documents both the success payload and the refusal payload including the isError flag. Combined with the auth requirement ('needs a trading key') and the ordering guarantee, nothing an agent needs to call this safely is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real constraint semantics: the stop must be tighter than the current one (a long's above, a short's below), must sit on the right side of the mark or it fires immediately, and when no stop exists any right-side price is accepted. That is placement logic the schema wording alone does not fully spell out.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource ('Move an open position's stop-loss tighter') plus the scope 'LIVE MONEY: acts on the real account'. It explicitly carves out what the tool does not do ('Never changes the target or the size') and names the siblings that cover those adjacent actions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit when-to-use ('lock in gains or cut risk'), an explicit when-not ('never wider') with the correct alternative named ('to widen a stop, close and re-enter with place_bracket'). It also routes two other cases to set_target and sweep_brackets, so the agent has a complete decision path.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.