Skip to main content
Glama

Update Strategy

tt_update_strategy
DestructiveIdempotent

Apply edits to an existing strategy and save.

LIVE-EDIT CONFIRM GATE: if this template is DEPLOYED, has SUBSCRIBERS, or is PUBLIC, a non-dry-run call refuses once with LIVE_EDIT_CONFIRMATION_REQUIRED — carrying the blast radius, the live-position consequences, and a copy alternative. RELAY those to the user, ask one confirm question, and only after the user explicitly agrees re-call with the SAME arguments plus live_edit_confirmed=true. Never set it on your own initiative.

MODIFY WORKFLOW (read this before any edit — there is NO rollback):

  1. tt_get_strategy() FIRST and keep the result. It is your only snapshot; nothing here can undo a write. (tt_get_strategy also re-validates the STORED strategy, so it doubles as a health check on what is live right now.)

  2. Rehearse with dry_run=True. Same validation, no write.

  3. Apply, then re-read to confirm what actually persisted. Prefer tt_apply_strategy_patch for a surgical single set/condition/leg change; this tool replaces whole top-level fields, sets included.

Heads-up when diffing before/after: a create/patch INJECTS blank Add Repair / Exit envelopes into each set as scaffolding, so a strategy read back will show conditions you did not author. They are inert placeholders, not a bug and not content loss.

A sets replacement that would REMOVE the strategy's Universal Exit is refused (STRATEGY_EDIT_UE_REMOVED) unless allow_universal_exit_removal=True — pass it only when the user explicitly wants the UE gone.

Edits top-level scalar fields (name, description, capital_required, currency, max_multiple / min_multiple, exit settings, tags, python_code, etc.) AND — since 2026-06-29 — a full sets replacement (structural). A structural edit routes through the clean create-shape + content-preservation check; if TT silently drops content it FAILS LOUD (STRATEGY_UPDATE_CONTENT_DROPPED). For SURGICAL add/remove/modify of an individual set/condition/leg, prefer tt_apply_strategy_patch. Do NOT recreate the strategy. Pass the TEMPLATE id, not a deployed SID — they are both 8-digit numbers and cannot be told apart by shape; get the template id from tt_list_my_strategies or a strategy's edit URL.

Call tt_list_editable_fields() to see the full list of allowed keys.

Args: strategy_id: integer ID from a prior create or list call. edits: dict of {top-level-field: new-value}. Non-empty. sets (the whole array) is allowed for structural changes. dry_run: validate and report what WOULD change without writing. Defaults to False (this tool writes by default, unlike tt_apply_strategy_patch). A dry run cannot predict a SERVER-side content drop — only the real POST can. live_edit_confirmed: set True ONLY after the user has been shown the LIVE_EDIT_CONFIRMATION_REQUIRED blast radius and consequences and explicitly agreed to edit the live template. Never set it on your own initiative. exchange_brokers: {exchange: broker_id}, e.g. {"BFO": 1021}. Send ONLY after a STRATEGY_EXCHANGE_BROKER_REQUIRED refusal, with the broker the USER picked from that error's details.missing[].brokers for each exchange. Tradetron then adds the broker to the user's running deployments of this template. Never guess or pick one yourself.

Returns on success: {"ok": True, "data": {"id", "name", "edit_url", "request_id", "changed_fields": []}}

SET IDS ARE NOT STABLE ACROSS AN EDIT. There is no partial-field wire here: any edit other than python_code reposts the whole body, and Tradetron deletes and recreates the SET rows on every such write. So a one-scalar edit — a description change — moves every set id, and each condition's strategy_template_set_id moves with it. Condition and leg ids are preserved. changed_fields reports the FIELDS you asked for and that persisted; it does not, and cannot, report the row churn. Never cache a set id across an edit — re-read with tt_get_strategy instead.

Possible error codes worth surfacing to the user: STRATEGY_VALIDATION_FAILED — edits would produce invalid spec STRATEGY_UPDATE_CONTENT_DROPPED — structural edit lost sets/ conditions/legs server-side STRATEGY_EXCHANGE_BROKER_REQUIRED — the user's running deployment has no broker for an exchange the edited legs now use; ask which broker, re-call with exchange_brokers. On success, relay data.subscriber_broker_warning if present: other users' deployments will not trade that exchange until they redeploy. STRATEGY_PARTIAL_PERSIST — TT 200 but some scalar fields silently dropped (see details.dropped)

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": {
      "strategy_id": "<strategy_id>",
      "edits": "<edits>"
    },
    "name": "tt_update_strategy"
  }
}

Input Schema

NameRequiredDescriptionDefault
editsYes
dry_runNo
strategy_idYes
exchange_brokersNo
live_edit_confirmedNo
allow_universal_exit_removalNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior1/5

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

The annotations declare `idempotentHint=true`, but the description says any edit other than `python_code` reposts the whole body, deletes and recreates SET rows on every such write, and that set IDs are not stable across an edit. A same-argument re-call therefore churns identifiers rather than leaving state unchanged, which contradicts the idempotency annotation. The description otherwise adds substantial behavioral context, but the annotation contradiction triggers a score of 1.

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?

The description is long, but it is organized around the confirm gate, modify workflow, caveats, args, returns, and error codes, with the critical information front-loaded. Some repetition exists, such as the repeated preference for `tt_apply_strategy_patch` and repeated 'never set it' warnings, but most of the length is justified for a destructive live-edit tool.

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 complex destructive mutation with no output schema, it is complete: it covers the pre-read requirement, dry-run limitations, live-edit confirmation behavior, set-ID churn, content-preservation checks, partial-persist failures, broker handling, and the success return shape. An agent has the operational context needed to avoid common failure modes.

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 description coverage is 0%, so the description must carry parameter meaning, and it does: it explains that `strategy_id` is a template ID rather than a deployed SID, that `edits` is a non-empty top-level dict allowing a whole `sets` array, that `dry_run` defaults to false unlike the patch tool and cannot predict server-side content drops, and exactly when to set `live_edit_confirmed`, `exchange_brokers`, and `allow_universal_exit_removal`.

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 opening sentence names the specific action ('apply edits to an existing strategy and save') and the resource. The description also scopes the operation to top-level scalar fields plus a full `sets` replacement, and explicitly distinguishes it from `tt_apply_strategy_patch` and from recreating the strategy.

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 an explicit workflow (read first, dry-run, apply, re-read) and names the alternative for surgical changes: `tt_apply_strategy_patch`. It also explains the live-edit confirmation gate and when to pass `exchange_brokers` or `allow_universal_exit_removal`, leaving little room for wrong invocation.

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