Skip to main content
Glama

set_target

Destructive

Moves an open perpetual position’s take-profit to a new price, replacing older targets while keeping the position protected if the new order is refused.

Instructions

LIVE MONEY: acts on the real account. Move an open position's take-profit to tp_px. One limit take-profit for the whole position goes on first, then every older target on the coin is cancelled, so the position always has a target and a refused new order leaves the old one in place. Refused: no open position, or a target on the losing side of the mark (it would fill at once). Never changes the stop or the size. Use to raise or lower a target. To move the stop use set_stop; to exit now use close_position; to fold duplicate targets left by several fills use sweep_brackets. Needs a trading key. Returns {ok, tp_px, size, replaced: old target prices}; a refusal is {ok: false, reason} 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>",
      "tp_px": "<tp_px>"
    },
    "name": "set_target"
  }
}

Input Schema

NameRequiredDescriptionDefault
coinYesCoin: a main-dex perp by name (BTC, ETH) or a HIP-3 perp as dex:SYMBOL (xyz:GOLD, xyz:BRENTOIL).
tp_pxYesNew target: above the mark for a long, below it for a short.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.6.1
    • addedInput schema / properties / coin / description
      Added value: +"Coin: a main-dex perp by name (BTC, ETH) or a HIP-3 perp as dex:SYMBOL (xyz:GOLD, xyz:BRENTOIL)."
    • addedInput schema / properties / tp_px / description
      Added value: +"New target: above the mark for a long, below it for a short."
  2. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations provide only destructiveHint=true; the description carries the rest and does so thoroughly. It discloses the real-money posture, the required ordering (new limit target placed first, then older targets on the coin cancelled, so the position is never naked), the atomicity guarantee that a refused new order leaves the old target in place, key requirements, and the exact refusal shape 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.

Conciseness5/5

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

The safety warning is front-loaded, then purpose, then the ordering guarantee, then refusals, then alternatives, then return shape. Every clause carries distinct operational content — there is no restatement of the tool name or filler.

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?

For a destructive real-money mutation with two required parameters and no output schema, the definition supplies everything missing elsewhere: auth needs, ordering semantics, refusal conditions, return payload {ok, tp_px, size, replaced}, and the error shape. Nothing an agent needs to invoke this safely is absent.

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

Parameters4/5

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

Schema coverage is 100%, so both coin and tp_px are already documented, which sets the baseline at 3. The description adds consequence-level meaning beyond the schema by explaining that a target on the losing side of the mark is refused because it would fill at once — turning a bare constraint into a predictable failure mode.

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?

States a specific verb and resource — 'Move an open position's take-profit to tp_px' — and immediately narrows scope with 'Never changes the stop or the size.' It explicitly separates itself from set_stop, close_position, and sweep_brackets, so an agent can route correctly without opening another schema.

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?

Gives both when-to-use ('Use to raise or lower a target') and named alternatives with their selecting conditions (set_stop for the stop, close_position to exit now, sweep_brackets for duplicate targets from several fills). It also states the exclusion cases — no open position, or a target on the losing side of the mark — which is exactly the decision information an agent needs.

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