Skip to main content
Glama
mnemox-ai

TradeMemory Protocol

by mnemox-ai

remember_trade

Store completed trades in multi-layer memory, automatically updating episodic records, Bayesian strategy stats, risk sizing, and confidence for outcome-based learning and bias detection.

Instructions

Store a trade into OWM multi-layer memory with automatic updates.

Writes to episodic memory and automatically updates semantic (Bayesian), procedural (running averages + hold time + Kelly), and affective (EWMA confidence/streaks). Also writes to trade_records for backward compatibility.

Input Schema

NameRequiredDescriptionDefault
pnlYesProfit/loss in account currency
pnl_rNoP&L as R-multiple (risk units). Improves OWM scoring quality.
symbolYesTrading instrument (e.g. "XAUUSD")
lot_sizeNoPosition size (lots, shares or contracts). Without it, patterns such as sizing up after a losing streak cannot be seen.
trade_idNoOptional custom ID. Auto-generated if omitted.
directionYes"long" or "short"
timestampNoISO format timestamp. Defaults to now (UTC).
confidenceNoAgent confidence level 0-1 (default 0.5)
exit_priceYesExit price of the trade
reflectionNoLessons learned from this trade
entry_priceYesEntry price of the trade
strategy_nameYesStrategy used (e.g. "VolBreakout")
context_atr_d1NoATR(14) on D1 in dollars
context_regimeNoMarket regime (trending_up/trending_down/ranging/volatile)
exit_timestampNoISO format exit time. Used to compute hold duration.
market_contextYesDescription of market conditions
entry_timestampNoISO format entry time. Used to compute hold duration.
max_adverse_excursionNoMaximum adverse excursion during the trade

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.6
    • addedInput schema / properties / lot_size
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Position size (lots, shares or contracts). Without it,\npatterns such as sizing up after a losing streak cannot be seen."
      +}
  2. Changed17 schema fields changedv0.5.4
    • addedInput schema / properties / confidence / description
      Added value: +"Agent confidence level 0-1 (default 0.5)"
    • addedInput schema / properties / context_atr_d1 / description
      Added value: +"ATR(14) on D1 in dollars"
    • addedInput schema / properties / context_regime / description
      Added value: +"Market regime (trending_up/trending_down/ranging/volatile)"
    • addedInput schema / properties / direction / description
      Added value: +"\"long\" or \"short\""
    • addedInput schema / properties / entry_price / description
      Added value: +"Entry price of the trade"
    • addedInput schema / properties / entry_timestamp
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "ISO format entry time. Used to compute hold duration."
      +}
    • addedInput schema / properties / exit_price / description
      Added value: +"Exit price of the trade"
    • addedInput schema / properties / exit_timestamp
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "ISO format exit time. Used to compute hold duration."
      +}
    • addedInput schema / properties / market_context / description
      Added value: +"Description of market conditions"
    • addedInput schema / properties / max_adverse_excursion / description
      Added value: +"Maximum adverse excursion during the trade"
    • addedInput schema / properties / pnl / description
      Added value: +"Profit/loss in account currency"
    • addedInput schema / properties / pnl_r / description
      Added value: +"P&L as R-multiple (risk units). Improves OWM scoring quality."
    • addedInput schema / properties / reflection / description
      Added value: +"Lessons learned from this trade"
    • addedInput schema / properties / strategy_name / description
      Added value: +"Strategy used (e.g. \"VolBreakout\")"
    • addedInput schema / properties / symbol / description
      Added value: +"Trading instrument (e.g. \"XAUUSD\")"
    • addedInput schema / properties / timestamp / description
      Added value: +"ISO format timestamp. Defaults to now (UTC)."
    • addedInput schema / properties / trade_id / description
      Added value: +"Optional custom ID. Auto-generated if omitted."
  3. First observedv0.4.0

TDQS

A4.2/5.0
Behavior5/5

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

Annotations only give the write (readOnlyHint=false) and non-idempotent profile, but the description goes well beyond by naming the exact downstream side effects: episodic write, Bayesian semantic update, procedural running averages/hold time/Kelly, EWMA affective confidence/streaks, and a trade_records backward-compat write. This is rich behavioral disclosure an agent could not infer from structured fields.

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?

Front-loads the verb+resource in the first clause, then layers the side effects, then closes with the compatibility note. Every sentence carries information and there is no filler.

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 18-parameter write tool with an output schema (so return values need not be explained) and full schema coverage, the description covers purpose and downstream effects adequately. The only gap is the absence of explicit guidance on when in a trade lifecycle to invoke it.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description does not add per-parameter meaning beyond the schema; its reference to hold time and Kelly loosely implies use of entry/exit timestamps and pnl_r, but the schema already documents those explicitly.

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 ('Store a trade into OWM multi-layer memory') and enumerates the concrete memory layers touched. No sibling in the list performs a trade write, so the operation is unambiguously distinct from the get_*/check_*/verify_* read tools.

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

Usage Guidelines3/5

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

Usage is only implied (you would call this to persist a completed trade). There is no explicit when-to-use statement, no note on prerequisites (e.g. close the trade first), and no comparison to any alternative write path.

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