MTContext Docs
Tool Reference

Journal

4 tools in this category.

Overview

Journal includes 4 tools for this workflow area.

Available tools: explain_setup, query_journal, score_journal_entry, write_trade_note.

Use the parameter tables and examples below as the canonical request contract.

explain_setup

Returns historical performance statistics for a named setup, aggregated over journal entries whose setup field matches, joined to realized P&L per ticket. Setup labels are supplied by the caller at journaling time (write_trade_note's setup parameter) — these statistics describe the caller's own labelling, not an independently detected pattern. avg_r_multiple is always null: no stop-loss value is currently persisted anywhere the server can join at query time. Results default to the caller's own terminal when the session is terminal-bound; pass terminal_id explicitly ('all'/'unassigned'/a real ID) for API-key sessions or to review across terminals. Available at Free+ tier.

Parameters

NameTypeRequiredDefaultDescription
setupstringYes
symbolstringNo
from_datestringNoISO date
to_datestringNoISO date
lookback_daysintegerNo90Used only when from_date/to_date are omitted.
terminal_idstringNoA real terminal ID, 'all' (every terminal), or 'unassigned' (legacy entries with no terminal). Defaults to the caller's own terminal when the session is terminal-bound.

Example Request

{
  "tool": "explain_setup",
  "arguments": {
    "setup": "setup_value"
  }
}

Usage Notes

  • Pass terminal_id only when you need to target a specific connected terminal.

query_journal

Queries trade journal entries (rationale/setup notes written via write_trade_note), newest first — NOT the MT5 terminal's system log (see get_terminal_journal_log for that). Filters: ticket, tag, setup, from_date/to_date (ISO), and search (case-insensitive text match). Entries linked to closed trades include realized_pnl when the terminal is connected (null otherwise). Results default to the caller's own terminal when the session is terminal-bound; pass terminal_id explicitly (a real terminal ID, 'all', or 'unassigned') for API-key sessions or to review across terminals. Available at Free+ tier. If a query scoped to one terminal comes back empty, the response includes a license_total_entries count when the license has journal entries elsewhere — that signals 'try terminal_id: "all"' rather than 'this license has no journal history'.

Parameters

NameTypeRequiredDefaultDescription
ticketintegerNo
tagstringNo
setupstringNo
from_datestringNoISO date
to_datestringNoISO date
searchstringNo
terminal_idstringNoA real terminal ID, 'all' (every terminal), or 'unassigned' (legacy entries with no terminal). Defaults to the caller's own terminal when the session is terminal-bound.
limitintegerNo20
offsetintegerNo0

Example Request

{
  "tool": "query_journal",
  "arguments": {}
}

Usage Notes

  • Pass terminal_id only when you need to target a specific connected terminal.

score_journal_entry

Scores a journal entry's self-review quality: rationale_clarity, evidence_cited, and plan_adherence (0-5 each) plus a 0-100 total, with suggested_tags. plan_adherence_basis reports whether the SL/TP comparison used the linked trade's actual exit price ('trade_history') or the text alone ('text_only', when unlinked or the terminal is unreachable). scorer is 'heuristic' (deterministic, computed on every call) or 'llm' (an optional enrichment computed out-of-path and persisted, preferred when present). The entry itself is never modified — this is a read-only score of an immutable entry. Available at Free+ tier.

Parameters

NameTypeRequiredDefaultDescription
entry_idstringYes

Example Request

{
  "tool": "score_journal_entry",
  "arguments": {
    "entry_id": "entry_id_value"
  }
}

write_trade_note

Persists a trade journal entry: rationale, setup label, and tags, optionally linked to a position/order ticket. Entries are append-only and immutable — to correct one, write a new note with amends_entry_id pointing at the original. Use at order time to capture WHY a trade was taken; query later with query_journal for post-trade review and per-setup statistics. Free tier stores up to 100 entries (license-wide, not per-terminal). New entries are tagged with the writing terminal automatically for terminal-bound sessions; API-key sessions (no bound terminal) should pass terminal_id explicitly, or the entry lands in the unassigned bucket. Available at Free+ tier.

Parameters

NameTypeRequiredDefaultDescription
textstringYes
ticketintegerNo
tagsarrayNo[]
setupstringNo
amends_entry_idstringNo
terminal_idstringNoExplicit terminal to tag this entry with — for API-key sessions (no bound terminal) or a terminal-bound session writing across terminals.

Example Request

{
  "tool": "write_trade_note",
  "arguments": {
    "text": "text_value"
  }
}

Usage Notes

  • Pass terminal_id only when you need to target a specific connected terminal.

On this page