gammaledger-mcp

v0.1.1
gammaledger-mcp Checked 3 days ago Published 1 month ago

MCP server for GammaLedger — privacy-first, local-first options trading journal

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

gammaledger_database_info

Return metadata about the loaded GammaLedger database. Includes file path, schema version, export date, trade count, whether the pre-computed `mcpContext` is present, and how fresh the data is: `dataAgeDays` (now minus the export date) and `isStale` (older than `staleAfterDays`, default 3). When `isStale` is true, positions, DTE and P&L describe the day of the export, not today - tell the user to re-save the database from the app. `warnings` lists anything else worth mentioning (failed refresh, unrecognised schema version).

gammaledger_portfolio_summary

Return the full portfolio snapshot — counts, P&L, performance ratios, risk metrics, fees, trading cadence, largest winner/loser. This is the headline dashboard view: total trades, win rate, profit factor, Sharpe/Sortino, max drawdown, expectancy, collateral at risk, realized vs unrealized P&L, current win/loss streak. `dataWarning` is set when the export is old or could not be refreshed.

gammaledger_pl_breakdown

Return time-windowed realised P&L: total, realized, unrealized, plus YTD, MTD, last 7d / 30d / 90d / 1y.

gammaledger_strategy_breakdown

Return per-strategy statistics: counts (total/open/closed/assigned), wins, losses, total P&L, win rate, average P&L. Sorted by P&L magnitude.

gammaledger_ticker_exposure

Return per-ticker performance: P&L, trade count, wins, losses, win rate, average P&L per trade. Sorted by absolute P&L. Args: top_n: Limit to top N tickers (default 15; the saved database holds at most 15).

ParameterTypeDescription
top_ninteger

gammaledger_underlying_breakdown

Return breakdown by underlying instrument type (Stock / ETF / Index / Future): trade counts, total P&L, capital at risk.

gammaledger_watchlist

Return the user's Watchlist: followed tickers with rating (1-5), notes, date added, and optional target price / direction. Databases saved before the Watchlist feature (schema < 2.6 / pre-2026-08) return an empty list. Args: ticker: Optional exact ticker filter (case-insensitive).

ParameterTypeDescription
tickerstring

gammaledger_open_positions

Return all currently open (active) positions, with optional filters. Each position is slimmed to the essentials by default (id, ticker, strategy, status, strike, quantity, expires, dte, pl, roi, capitalAtRisk) to save context. Pass `fields` to choose others, or `fields='all'` for the full record (adds entryPrice, daysHeld, cashFlow, fees, wheelCoverage, unrealizedPL, notes, ...). DTE and P&L are as of the export date; check `dataWarning` when present. Args: ticker: Filter by exact ticker (case-insensitive, e.g. 'SPY'). s…

ParameterTypeDescription
dte_max
fieldsstring
strategystring
tickerstring
underwater_onlyboolean

gammaledger_position

Return the full detail (including all legs) for a specific trade. The result has two parts: `trade` is the persisted record (legs, dates, notes) and `summary` is the computed view (P&L, ROI, DTE, capital at risk, Wheel/PMCC basis). `summary.plSource` says where the numbers came from: 'app' = embedded by the GammaLedger app (active positions, Wheel/PMCC positions, the 10 most recent closed trades); 'derived' = realized P&L recomputed from the legs of an older Closed/Expired trade (same rules as the app: credits minus debits minus fees; no…

ParameterTypeDescription
trade_id *string

gammaledger_wheel_pmcc_positions

Return Wheel and PMCC tracker positions with cost basis, premium history summary, and coverage status. Args: position_type: Filter by 'wheel' or 'pmcc'. Empty returns both.

ParameterTypeDescription
position_typestring

gammaledger_recent_closed_trades

Return the most recently closed trades (sorted by close date). The GammaLedger app embeds only its 10 most recent closed trades in the saved database, so that is the most this can return. Use `gammaledger_search_trades` (status='Closed', optionally with `closed_after`) to list older ones - their P&L is derived from the legs. Args: limit: Maximum number of trades to return (default 10, max 10).

ParameterTypeDescription
limitinteger

gammaledger_search_trades

Search across the full trade history with optional filters. Unlike `gammaledger_open_positions` (active only) or `gammaledger_recent_closed_trades` (the last 10 closed), this scans every trade - open, closed, expired, assigned. `pl` covers the whole history. `plSource` tells you where it came from: 'app' (computed by GammaLedger) or 'derived' (recomputed from the trade's legs for Closed/Expired trades the app did not embed - same arithmetic as the app). `pl` is null for open trades the app did not embed; those are left out whenever a…

ParameterTypeDescription
closed_afterstring
closed_beforestring
descendingboolean
fieldsstring
limitinteger
opened_afterstring
opened_beforestring
pl_max
pl_min
sort_bystring
statusstring
strategystring
tickerstring

gammaledger_concentration_risk

Return the top concentrated active positions by capital at risk, with each position's share of total collateral as a percentage.

gammaledger_expiring_positions

Return active positions expiring within N days, sorted by DTE ascending. DTE is as of the export date; check `dataWarning` when present. Args: within_days: Look-ahead window in days (default 7, max 365).

ParameterTypeDescription
within_daysinteger

gammaledger_audit_risk

Comprehensive risk audit: drawdown, concentration, expiring, underwater positions, Wheel/PMCC coverage gaps. Returns structured findings grouped by severity (high / watch / healthy).

gammaledger_audit_wheel_pmcc

Audit Wheel and PMCC positions — flags coverage gaps, cost-basis awareness, and premium-collection effectiveness.