Skip to main content
Glama

AlgoVesta MCP Trading

modify_position

DestructiveIdempotent

Updates the SL/TP of an open position on a crypto exchange or FOREX/MT5. AT LEAST ONE of new_sl/new_tp must be given. SL CANNOT BE REMOVED (the mandatory-SL rule stands). Logic: long requires new_sl < mark < new_tp, short the reverse. idempotency_key is REQUIRED.

If you send only ONE side, the other keeps the position's CURRENT value — the side
you omit is NOT deleted. If several MT5 positions are open on the same symbol,
`ticket` becomes REQUIRED; while it is ambiguous, NONE are modified.

get_portfolio_context shows the current SL/TP of each position.

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": {
      "venue": "<venue>",
      "symbol": "<symbol>",
      "side": "<side>",
      "idempotency_key": "<idempotency_key>"
    },
    "name": "modify_position"
  }
}

Input Schema

NameRequiredDescriptionDefault
sideYes'buy' (long) or 'sell' (short). The side the user stated.
venueYesExchange/venue name — must be one of the user's CONNECTED accounts (e.g. binance, bybit, okx, mt5, paper). A venue that is not connected is rejected with VENUE_NOT_CONNECTED.
new_slNoNew SL price. SL CANNOT BE REMOVED (0/negative is rejected) - the mandatory-SL rule stands. At least one of new_sl or new_tp must be given.
new_tpNoNew TP price. At least one of new_sl or new_tp must be given.
symbolYesTrading symbol, e.g. BTCUSDT, ETHUSDT, EURUSD.
ticketNoFOREX/MT5 only: the ticket number of the position this action targets (the 'ticket' field on forex positions in get_portfolio_context). REQUIRED when several positions are open on the same symbol — if which one is meant is not certain, nothing is done. May be left empty when there is only one position.
accountNoTARGET ACCOUNT — the account this call acts on (for place_order/simulate_order the account the order is opened in; for close/modify the account holding the position). For MT5 the login number (e.g. '12345678'), for exchanges the account label (e.g. 'Binance2'). Copy it EXACTLY from the 'account' field in the get_portfolio_context output. REQUIRED when the user has more than one account in the same market: if left empty the action is NOT performed and the user is asked which account — it is never silently applied to the default/primary account.
idempotency_keyYesClient-generated unique idempotency key (min 8 characters). Reuse the SAME key when retrying the same action — the stored response is replayed and the action is NOT performed a second time.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing the mandatory-SL rule (SL cannot be removed, 0/negative rejected), the fail-closed semantics when the MT5 ticket is ambiguous ('NONE are modified'), and the account-resolution rule that an empty account is never silently defaulted. These are non-obvious behavioral constraints that an agent could not infer from destructiveHint/idempotentHint alone.

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?

Front-loads the core action, then constraints, then the prerequisite read, with caps used sparingly for the hard rules. Slightly dense and repeats a few schema points, but nearly every sentence carries a constraint an agent needs.

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

Completeness4/5

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

For an 8-parameter destructive mutation with no output schema, the definition covers preconditions, ambiguity handling, and idempotent retry semantics well. The remaining gap is that it never describes what a successful call returns (e.g. resulting SL/TP or a receipt), which matters given there is no output schema.

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 the baseline is 3, but the description adds genuine meaning the schema lacks: that omitting new_sl or new_tp preserves the CURRENT value rather than deleting that side, and that a single-side update is a valid partial mutation. It also reinforces the long/short ordering constraint (long requires new_sl < mark < new_tp) that is absent from the property descriptions.

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 ('Updates the SL/TP of an open position') plus the venue scope (crypto exchange or FOREX/MT5). This is immediately distinguishable from siblings like close_position, place_order, and get_portfolio_context.

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

Usage Guidelines4/5

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

Gives concrete preconditions: at least one of new_sl/new_tp must be supplied, idempotency_key is required, ticket becomes mandatory when several MT5 positions share a symbol, and account becomes mandatory when the user has multiple accounts in the same market. It also points to get_portfolio_context as the way to read current SL/TP. It stops short of explicitly naming close_position as the tool to use when the user wants to exit rather than adjust.

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.