Skip to main content
Glama

Prepare take profit / stop loss

perps_prepare_auto_close_set
Read-only

Previews changing the take-profit / stop-loss legs of an open position. Read-only safety gate: runs risk checks and returns a short-lived confirmation token (~90s). Present the summary, get explicit user confirmation, then call perps_execute_operation with the token. Makes no changes itself. OMIT takeProfit/stopLoss entirely to keep that leg's price, pass {action:"set", priceQuote} to set or replace it, or {action:"delete"} to remove it. Omitting a leg does not delete it — you don't need to re-send the other leg's current value; a live omitted leg is re-issued at the same price under a new order id. At least one leg is required. Execution is asynchronous: after perps_execute_operation confirm the result via perps_list_positions -> auto_close, which lists only levels that are actually live.

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": {
      "contractId": "<contractId>"
    },
    "name": "perps_prepare_auto_close_set"
  }
}

Input Schema

NameRequiredDescriptionDefault
stopLossNoThe stop-loss leg. OMIT THIS OBJECT ENTIRELY to keep the current stop-loss price — an absent leg keeps its price (a live one is re-issued under a new order id). Include it only to change that leg.
contractIdYesNumeric contract id from perps_list_contracts with an open position. 0 is a real contract id, not a placeholder for "unset".
takeProfitNoThe take-profit leg. OMIT THIS OBJECT ENTIRELY to keep the current take-profit price — an absent leg keeps its price (a live one is re-issued under a new order id). Include it only to change that leg.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Goes well beyond the annotations: risk checks, a ~90s confirmation token, no mutation by itself, asynchronous execution, order-id re-issue for untouched legs, and a verification path via perps_list_positions -> auto_close. The only gap is that it doesn't say what happens if the token expires or a risk check fails.

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?

Purpose and the read-only framing are front-loaded, and nearly every clause carries operational weight. There is mild redundancy between 'Makes no changes itself' and 'Read-only safety gate', and between the omit-leg rule in prose and in the schema descriptions.

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 preview/confirmation-token tool with nested leg objects and no output schema, the description covers the full lifecycle: what it returns, how long the token lives, how to execute, and how to verify the eventual result. Nothing an agent needs to call it correctly is missing.

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 already 100%, so the baseline is 3; the description earns above baseline by reinforcing the omit-vs-set-vs-delete contract, stating that omitting does not delete and that at least one leg is required — semantics an agent must get right at call time.

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 ('Previews changing the take-profit / stop-loss legs of an open position') and explicitly positions itself as the read-only precursor to perps_execute_operation, so an agent can distinguish it from the execution sibling without opening either 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 an explicit three-step workflow (present summary, get user confirmation, call perps_execute_operation with the token) plus leg-level rules: omit to keep price, set to install/replace, delete to remove, and at least one leg required. The when-to-use and when-not-to-use conditions are both spelled out.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources