agent-trading-journal
v0.1.0AI trading journal: your agent logs trades from chart screenshots and checks your own rules.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_setup_status Setup status (call first)
Profile, strategies, accounts and counts. Tells you whether onboarding is needed.
get_onboarding_guide Onboarding interview guide
The interview script for setting the journal up around this trader. Follow it when get_setup_status says onboarding is needed.
get_workflow Get a workflow
Step-by-step instructions for a packaged workflow: onboarding, log_trade_from_screenshot, weekly_review, pre_session_check.
| Parameter | Type | Description |
|---|---|---|
name * | string |
set_profile Save trader profile
Upsert trader profile entries (language, markets, style, sessions, timezone, experience, goals, weaknesses, ...). null deletes a key.
| Parameter | Type | Description |
|---|---|---|
entries * | object |
list_presets List strategy presets
Example strategies to start from (always adapt them to the user).
import_preset Import a preset as a strategy
Copy a preset into the journal as a strategy (optionally under a new slug/name), then edit it with upsert_strategy.
| Parameter | Type | Description |
|---|---|---|
preset * | string | |
name | string | |
slug | string |
upsert_strategy Create / update a strategy
Save the full strategy definition: plan, custom fields (what to measure per trade) and rules (entry checklist). Fields/rules left out are archived, not deleted.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
description | string | |
fields | array | |
markets | string | |
plan | object | summary, bias, setup, entry, stop, targets, management, no_trade |
rules | array | |
slug | string | short id; derived from name when omitted. Same slug = update (version bumps if fields/rules change) |
timeframes | string |
get_strategy Get a strategy
Full definition with field guides and rules. Call before logging trades.
| Parameter | Type | Description |
|---|---|---|
strategy * | string | slug or name |
include_archived | boolean |
list_strategies List strategies
All strategies with version, number of fields/rules and trades.
export_strategy Export a strategy
Portable JSON of a strategy (same format as presets) — to back up or share.
| Parameter | Type | Description |
|---|---|---|
strategy * | string | |
path | string | optional .json file path to write |
upsert_account Create / update an account
Trading account with its risk limits (prop-firm style). Same name = update; omitted fields stay unchanged.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
currency | string | |
max_consecutive_losses | integer | |
max_daily_loss_pct | number | |
max_total_drawdown_pct | number | |
max_trades_per_day | integer | |
notes | string | |
profit_target_pct | number | |
risk_per_trade_pct | number | e.g. 0.5 = 0.5% per trade |
starting_balance | number | |
type | string |
list_accounts List accounts
Accounts with their limits.
check_risk Check account risk limits
Today's R and estimated % vs the account's daily loss / drawdown / trade-count / loss-streak limits. status: ok | caution | stop.
| Parameter | Type | Description |
|---|---|---|
account * | string | |
date | string | YYYY-MM-DD, default today |
start_session Start a session
A backtest / forward / live session. Returns session_id for log_trade.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | |
account | string | account name (created if new) — for forward/live |
data_from | string | backtest: start of the replayed range |
data_to | string | |
date | string | YYYY-MM-DD, default today |
mode | string | |
notes | string | |
settings_json | string | JSON of settings that differ from the defaults |
strategy | string | strategy slug — trades inherit it |
timeframes | string | |
tool_version | string | indicator / tool version used |
list_sessions List sessions
Sessions with trade count, win count and total R.
| Parameter | Type | Description |
|---|---|---|
account | string | account name |
mode | string | |
strategy | string | strategy slug |
log_trade Log a trade or skipped setup
Log one trade into a session with custom fields and rule checks. Skipped setups count too (status=skipped + skip_reason). RR, R and outcome are derived when possible.
| Parameter | Type | Description |
|---|---|---|
session_id * | integer | |
chart_time | string | entry time on the chart, "YYYY-MM-DD HH:mm" in the trader's timezone |
closed_at | string | |
confidence | integer | |
direction | string | |
entry | number | |
exit_price | number | average exit price; R is derived from entry/sl when result_r is not given |
exit_reason | string | |
fields | object | custom fields defined by the strategy (see get_strategy), e.g. {"setup_type":"pullback","news_nearby":false} |
mae_r | number | max adverse excursion in R (how far it went against you) |
mfe_r | number | max favourable excursion in R (how far it went your way) |
mistakes | string | discipline / execution mistakes |
moved_be | boolean | |
notes | string | |
outcome | string | derived from result_r when omitted; leave empty while open |
partial_taken | boolean | |
pnl | number | realised P&L in account currency |
quantity | number | |
result_r | number | realised R, net of fees when known |
rr_planned | number | derived from entry/sl/tp when omitted |
rules | object | rule checks by rule key: "pass" | "fail" | "na" (or {result, note}) |
skip_correct | boolean | later review: was skipping right? |
skip_reason | string | required when status=skipped |
sl | number | |
status | string | default taken; a valid setup the user stayed out of = skipped |
strategy | string | strategy slug — defaults to the session strategy |
tags | string | comma-separated |
tp | number | |
tp2 | number |
update_trade Update a trade
Change any field, custom field or rule check. Send only what changes.
| Parameter | Type | Description |
|---|---|---|
trade_id * | integer | |
chart_time | string | entry time on the chart, "YYYY-MM-DD HH:mm" in the trader's timezone |
closed_at | string | |
confidence | integer | |
direction | string | |
entry | number | |
exit_price | number | average exit price; R is derived from entry/sl when result_r is not given |
exit_reason | string | |
fields | object | custom fields defined by the strategy (see get_strategy), e.g. {"setup_type":"pullback","news_nearby":false} |
mae_r | number | max adverse excursion in R (how far it went against you) |
mfe_r | number | max favourable excursion in R (how far it went your way) |
mistakes | string | discipline / execution mistakes |
moved_be | boolean | |
notes | string | |
outcome | string | derived from result_r when omitted; leave empty while open |
partial_taken | boolean | |
pnl | number | realised P&L in account currency |
quantity | number | |
result_r | number | realised R, net of fees when known |
rr_planned | number | derived from entry/sl/tp when omitted |
rules | object | rule checks by rule key: "pass" | "fail" | "na" (or {result, note}) |
skip_correct | boolean | later review: was skipping right? |
skip_reason | string | required when status=skipped |
sl | number | |
status | string | default taken; a valid setup the user stayed out of = skipped |
strategy | string | strategy slug — defaults to the session strategy |
tags | string | comma-separated |
tp | number | |
tp2 | number |
delete_trade Delete a trade
Delete a trade logged by mistake (with its rule checks and screenshot records).
| Parameter | Type | Description |
|---|---|---|
trade_id * | integer |
query_trades Query trades
Trades matching filters, newest first.
| Parameter | Type | Description |
|---|---|---|
account | string | account name |
fields | object | filter on custom field values, e.g. {"setup_type":"pullback"} |
from | string | YYYY-MM-DD (trade date) |
limit | integer | |
mode | string | |
outcome | string | |
session_id | integer | |
status | string | |
strategy | string | strategy slug |
symbol | string | |
tag | string | |
to | string | YYYY-MM-DD (trade date) |
get_trade Get a trade
One trade with fields, rule checks, screenshots and lessons.
| Parameter | Type | Description |
|---|---|---|
trade_id * | integer |
add_screenshot Attach a screenshot
Copy an image (png/jpg/gif/webp, absolute path) into the journal and attach it to a trade.
| Parameter | Type | Description |
|---|---|---|
source_path * | string | |
trade_id * | integer | |
caption | string | timeframe, before/after entry, ... |
add_lesson Add a lesson
Record a lesson linked to a session and/or trade. Suggested categories: discipline, strategy, market, risk, psychology, execution.
| Parameter | Type | Description |
|---|---|---|
category * | string | |
text * | string | |
session_id | integer | |
strategy | string | |
trade_id | integer |
update_lesson Update a lesson
Edit text or category.
| Parameter | Type | Description |
|---|---|---|
lesson_id * | integer | |
category | string | |
text | string |
delete_lesson Delete a lesson
Delete a lesson recorded by mistake.
| Parameter | Type | Description |
|---|---|---|
lesson_id * | integer |
list_lessons List lessons
Lessons, newest first.
| Parameter | Type | Description |
|---|---|---|
account | string | |
category | string | |
limit | integer | |
mode | string | |
session_id | integer | |
strategy | string | |
trade_id | integer |
get_stats Stats
Win rate, total R, expectancy, profit factor, payoff, drawdown, streaks, Edge Score, breakdowns (direction, symbol, weekday, hour, every custom field), rule adherence, calendar, equity curve.
| Parameter | Type | Description |
|---|---|---|
account | string | account name |
fields | object | filter on custom field values, e.g. {"setup_type":"pullback"} |
from | string | YYYY-MM-DD (trade date) |
mode | string | |
session_id | integer | |
strategy | string | strategy slug |
symbol | string | |
tag | string | |
to | string | YYYY-MM-DD (trade date) |
run_sql_readonly Read-only SQL
Any SELECT for ad-hoc analysis. Tables: profile, strategies, strategy_fields, strategy_rules, accounts, sessions, trades (custom fields in fields_json → json_extract), trade_rule_checks, attachments, lessons.
| Parameter | Type | Description |
|---|---|---|
sql * | string | SELECT/WITH only |
import_statement Import a broker statement
Import closed trades from an export file. Formats: MetaTrader 4/5 (HTML statement), Interactive Brokers (activity statement), Interactive Brokers (Flex Query), ThinkorSwim / Charles Schwab (account statement), TradeZella (trades export), Tradervue (executions export), TopstepX (fills export), TradingView (paper trading history), NinjaTrader (executions export), Tradovate (orders export), Webull (orders export), DAS Trader Pro (executions export). Duplicates are skipped. Run with dry_run first.
| Parameter | Type | Description |
|---|---|---|
account * | string | |
path * | string | absolute path to the exported file |
dry_run | boolean | |
file_timezone | string | timezone of naive timestamps in the file, if different |
mode | string | default live |
multipliers | object | contract multipliers per symbol for futures |
strategy | string | |
symbol | string | only for files without a symbol column |
timezone | string | IANA timezone for chart_time (default: profile timezone) |
export_review Export a review (Markdown)
Markdown review of a scope (Obsidian-friendly). Returns the text, or writes it to path.
| Parameter | Type | Description |
|---|---|---|
account | string | account name |
fields | object | filter on custom field values, e.g. {"setup_type":"pullback"} |
from | string | YYYY-MM-DD (trade date) |
mode | string | |
path | string | .md file to write |
session_id | integer | |
strategy | string | strategy slug |
symbol | string | |
tag | string | |
title | string | |
to | string | YYYY-MM-DD (trade date) |
start_dashboard Start dashboard
Start the local web dashboard (http://localhost:3777). Only when the user asks.
stop_dashboard Stop dashboard
Stop the dashboard started by this server.
dashboard_status Dashboard status
Whether the dashboard started by this server is running.