Agent Financial Advisor is an MCP server published by io.github.mytomclinic, hosted at agent-financial-advisor.agent-financial-advisor.workers.dev. When last checked on 2026-11-23 it was working: it answers and lists its tools. It declares 11 tools, including rules_digest, pre_trade_check, position_size, tax_lot_plan, portfolio_review.
Compliance, risk, tax and audit checks for AI trading agents: pre-trade, sizing, wash sales, Reg BI.
Nothing else in the archive shares these values.
Squares are this server's values; dots are other servers sharing them. A shared address or publisher is a lead, not proof of a common operator.
Inferred from the host name and headers: what a server runs on, not who runs it.
Free. The current US trading, margin, settlement and tax rules an agent must follow, with effective dates and sources. Includes changes your training data may predate, such as the June 2026 replacement of the Pattern Day Trader rule. Price: free.
| Parameter | Type | Description |
|---|---|---|
| topic | string | one of ["intraday_margin","legacy_pdt","reg_t","settlement","cash_account","short_sale","wash_sale","holding_period","options_margin","options_cash_account","options_exercise","reg_bi"] |
| api_key | string | Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial. |
{
"name": "rules_digest",
"title": "Current trading rules digest",
"description": "Free. The current US trading, margin, settlement and tax rules an agent must follow, with effective dates and sources. Includes changes your training data may predate, such as the June 2026 replacement of the Pattern Day Trader rule. Price: free.",
"inputSchema": {
"type": "object",
"properties": {
"topic": {
"enum": [
"intraday_margin",
"legacy_pdt",
"reg_t",
"settlement",
"cash_account",
"short_sale",
"wash_sale",
"holding_period",
"options_margin",
"options_cash_account",
"options_exercise",
"reg_bi"
],
"type": "string"
},
"api_key": {
"type": "string",
"description": "Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial."
}
}
}
}Run an order past a compliance officer and risk manager before sending it to the broker. Checks buying power, cash-account settlement violations, FINRA intraday margin (post-PDT) or legacy PDT limits, Reg SHO short-sale rules, wash-sale exposure, position concentration, per-trade risk versus stop, liquidity, spread, fat-finger prices, leverage and market hours. Returns approve / approve_with_warnings / reject with reasons and a resized quantity when useful. Price: $0.005.
| Parameter | Type | Description |
|---|---|---|
| order * | object | |
| market | object | |
| policy | object | Override risk limits. Defaults: {"max_position_pct":0.2,"max_order_risk_pct":0.02,"max_adv_pct":0.05,"max_spread_pct":0.01,"max_gross_leverage":2,"max_limit_deviation_pct":0.1,"allow_short":true,"allow_extended_hours":false,"require_stop":false} |
| account * | object | Account state before the order. |
| api_key | string | Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial. |
{
"name": "pre_trade_check",
"title": "Pre-trade compliance and risk check",
"description": "Run an order past a compliance officer and risk manager before sending it to the broker. Checks buying power, cash-account settlement violations, FINRA intraday margin (post-PDT) or legacy PDT limits, Reg SHO short-sale rules, wash-sale exposure, position concentration, per-trade risk versus stop, liquidity, spread, fat-finger prices, leverage and market hours. Returns approve / approve_with_warnings / reject with reasons and a resized quantity when useful. Price: $0.005.",
"inputSchema": {
"type": "object",
"examples": [
{
"order": {
"side": "buy",
"symbol": "AAPL",
"quantity": 50,
"limit_price": 200,
"stop_loss_price": 190
},
"market": {
"ask": 200.02,
"bid": 199.98,
"last_price": 200,
"avg_daily_volume": 50000000
},
"account": {
"type": "margin",
"equity": 100000,
"positions": []
}
}
],
"required": [
"account",
"order"
],
"properties": {
"order": {
"type": "object",
"required": [
"symbol",
"side",
"quantity"
],
"properties": {
"side": {
"enum": [
"buy",
"sell",
"sell_short",
"buy_to_cover"
]
},
"symbol": {
"type": "string"
},
"quantity": {
"type": "number"
},
"timestamp": {
"type": "string",
"description": "ISO time the order will be sent; defaults to now."
},
"order_type": {
"enum": [
"market",
"limit",
"stop",
"stop_limit"
]
},
"limit_price": {
"type": "number"
},
"stop_loss_price": {
"type": "number",
"description": "Planned protective stop, used for risk-per-trade."
},
"locate_confirmed": {
"type": "boolean"
}
}
},
"market": {
"type": "object",
"properties": {
"ask": {
"type": "number"
},
"bid": {
"type": "number"
},
"halted": {
"type": "boolean"
},
"last_price": {
"type": "number"
},
"prev_close": {
"type": "number"
},
"avg_daily_volume": {
"type": "number"
}
}
},
"policy": {
"type": "object",
"description": "Override risk limits. Defaults: {\"max_position_pct\":0.2,\"max_order_risk_pct\":0.02,\"max_adv_pct\":0.05,\"max_spread_pct\":0.01,\"max_gross_leverage\":2,\"max_limit_deviation_pct\":0.1,\"allow_short\":true,\"allow_extended_hours\":false,\"require_stop\":false}"
},
"account": {
"type": "object",
"required": [
"type",
"equity"
],
"properties": {
"cash": {
"type": "number"
},
"type": {
"enum": [
"cash",
"margin"
]
},
"equity": {
"type": "number",
"description": "Net liquidation value (USD)."
},
"positions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"sector": {
"type": "string"
},
"symbol": {
"type": "string"
},
"avg_cost": {
"type": "number"
},
"quantity": {
"type": "number",
"description": "Negative for short."
},
"market_price": {
"type": "number"
},
"opened_today": {
"type": "boolean"
}
}
}
},
"buying_power": {
"type": "number",
"description": "Broker-reported buying power, if known."
},
"recent_sales": {
"type": "array",
"items": {
"type": "object",
"properties": {
"date": {
"type": "string"
},
"symbol": {
"type": "string"
},
"quantity": {
"type": "number"
},
"realized_pnl": {
"type": "number"
}
}
},
"description": "Sales in the last 30 days, for wash-sale checks."
},
"settled_cash": {
"type": "number",
"description": "Cash accounts: settled funds available."
},
"day_trade_regime": {
"enum": [
"intraday_margin",
"legacy_pdt"
],
"description": "Defaults by date; brokers may phase in until 2027-10-20."
},
"day_trades_last_5_days": {
"type": "integer"
}
},
"description": "Account state before the order."
},
"api_key": {
"type": "string",
"description": "Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial."
}
}
}
}Size a position the way a risk manager would: fixed-fractional risk to a stop, volatility targeting (ATR or annualized vol), or fractional Kelly from your edge statistics. Applies a max-position cap and round lots, and explains the binding constraint. Price: $0.005.
| Parameter | Type | Description |
|---|---|---|
| atr | number | volatility: average true range in price units. |
| side | enum | one of ["long","short"] |
| equity * | number | |
| method * | enum | one of ["fixed_fractional","volatility","kelly"] |
| api_key | string | Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial. |
| avg_win | number | kelly: average win (any unit, same as avg_loss). |
| avg_loss | number | kelly: average loss as a positive number. |
| lot_size | integer | Round down to this multiple, default 1. |
| risk_pct | number | fixed_fractional: fraction of equity to risk, default 0.01. |
| win_rate | number |
Act as the tax advisor for a sale: compares FIFO, LIFO, HIFO and minimum-tax lot selection, splits short- and long-term gains, estimates tax, flags wash sales, and notes lots about to turn long-term. With mode=harvest it scans positions for tax-loss harvesting. Price: $0.02.
| Parameter | Type | Description |
|---|---|---|
| lots * | array | |
| mode | enum | one of ["sell","harvest"] |
| sell | object | mode=sell |
| as_of | string | mode=harvest: date, default today |
| prices | object | mode=harvest: {SYMBOL: current price} |
| symbol | string | |
| api_key | string | Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial. |
| tax_rates | object | |
| min_harvest_loss | number | mode=harvest: ignore losses smaller than this (USD), default 100. |
| recent_transactions | array |
A periodic advisor review of a portfolio: weights, concentration (HHI and effective number of holdings), sector and asset-class exposure, drift from targets with the trades to rebalance, and, given return history, volatility, Sharpe, Sortino, drawdown, VaR/CVaR and beta. Ends with prioritized findings. Price: $0.05.
| Parameter | Type | Description |
|---|---|---|
| cash | number | |
| limits | object | |
| api_key | string | Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial. |
| returns | array | Periodic portfolio returns as decimals. |
| targets | object | Target weights by symbol or asset_class, summing to 1. |
| holdings * | array | |
| rebalance_band | number | Absolute drift that triggers a rebalance, default 0.05. |
| risk_free_rate | number | |
| periods_per_year | number | |
| benchmark_returns | array |
An independent performance auditor for a trading strategy or backtest. From a trade list and/or periodic returns it computes win rate, expectancy, profit factor, streaks, Sharpe/Sortino/drawdown, and tests whether the edge is real: t-stat, Probabilistic Sharpe Ratio and the Deflated Sharpe Ratio that corrects for how many variants you tried. Returns a verdict and red flags. Price: $0.1.
| Parameter | Type | Description |
|---|---|---|
| trades | array | Closed trades. |
| api_key | string | Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial. |
| returns | array | Periodic strategy returns as decimals. |
| n_trials | integer | How many strategy/parameter variants were tested before picking this one. Default 1. |
| starting_equity | number | For risk-of-ruin and drawdown in dollars from trades. |
| periods_per_year | number | |
| avg_trial_correlation | number | Average pairwise correlation (0 to 1) between the returns of the variants you tested. Near-duplicate variants (a 20-day vs. 21-day lookback) are not independent trials; with this the audit deflates by an effective trial count instead of the raw n_trials. |
| trial_sharpe_variance | number | Variance of per-period Sharpe across trials, if known. |
The compliance review a robo-advisor or advisory agent should run before recommending a portfolio to a person: compares the proposal with the client's age, horizon, risk tolerance, liquidity needs and experience under Reg BI / fiduciary standards, flags complex products, and returns a timestamped, hashed suitability memo for the audit file. Price: $0.03.
| Parameter | Type | Description |
|---|---|---|
| client * | object | |
| api_key | string | Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial. |
| products | array | Complex products included. |
| allocation * | object | Weights by asset class: equity, bonds, cash, alternatives, crypto... summing to 1. |
| annual_fee_pct | number | All-in annual cost (advisory + fund expenses). |
| max_single_position_pct | number |
{
"name": "suitability_check",
"title": "Best-interest suitability review",
"description": "The compliance review a robo-advisor or advisory agent should run before recommending a portfolio to a person: compares the proposal with the client's age, horizon, risk tolerance, liquidity needs and experience under Reg BI / fiduciary standards, flags complex products, and returns a timestamped, hashed suitability memo for the audit file. Price: $0.03.",
"inputSchema": {
"type": "object",
"examples": [
{
"client": {
"age": 72,
"client_ref": "c1",
"experience": "limited",
"horizon_years": 5,
"risk_tolerance": "conservative",
"liquidity_need_pct": 0.1
},
"products": [
"leveraged_etf"
],
"allocation": {
"cash": 0.05,
"bonds": 0.25,
"equity": 0.7
}
}
],
"required": [
"client",
"allocation"
],
"properties": {
"client": {
"type": "object",
"properties": {
"age": {
"type": "number"
},
"net_worth": {
"type": "number"
},
"client_ref": {
"type": "string",
"description": "Your internal id; do not send names or account numbers."
},
"experience": {
"enum": [
"none",
"limited",
"good",
"extensive"
]
},
"objectives": {
"type": "array",
"items": {
"type": "string"
}
},
"annual_income": {
"type": "number"
},
"horizon_years": {
"type": "number"
},
"risk_tolerance": {
"description": "conservative | moderate | aggressive, or 1-10"
},
"liquidity_need_pct": {
"type": "number",
"description": "Share of assets needed within 12 months."
}
}
},
"api_key": {
"type": "string",
"description": "Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial."
},
"products": {
"type": "array",
"items": {
"enum": [
"leveraged_etf",
"options",
"crypto",
"penny_stock",
"private_placement"
]
},
"description": "Complex products included."
},
"allocation": {
"type": "object",
"description": "Weights by asset class: equity, bonds, cash, alternatives, crypto... summing to 1."
},
"annual_fee_pct": {
"type": "number",
"description": "All-in annual cost (advisory + fund expenses)."
},
"max_single_position_pct": {
"type": "number"
}
}
}
}Check an options book (existing or proposed legs) the way a broker's options desk would: covered, cash-secured, spread or naked; margin requirement under FINRA Rule 4210; cash-account limits; required approval level; early-assignment risk around ex-dividend dates; pin risk; auto-exercise of expiring in-the-money longs and the capital it needs; max loss; and net Greeks. Returns approve / approve_with_warnings / reject with reasons. Price: $0.01.
| Parameter | Type | Description |
|---|---|---|
| legs * | array | |
| as_of | string | Date of the check (YYYY-MM-DD); defaults to today in New York. |
| policy | object | Overrides: pin_band_pct, max_requirement_pct_of_equity, max_delta_dollars_pct_of_equity, assignment_dte, low_extrinsic. |
| account * | object | |
| api_key | string | Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial. |
| underlying * | object |
{
"name": "options_risk_check",
"title": "Options risk and margin check",
"description": "Check an options book (existing or proposed legs) the way a broker's options desk would: covered, cash-secured, spread or naked; margin requirement under FINRA Rule 4210; cash-account limits; required approval level; early-assignment risk around ex-dividend dates; pin risk; auto-exercise of expiring in-the-money longs and the capital it needs; max loss; and net Greeks. Returns approve / approve_with_warnings / reject with reasons. Price: $0.01.",
"inputSchema": {
"type": "object",
"examples": [
{
"legs": [
{
"side": "short",
"type": "call",
"expiry": "2026-11-20",
"strike": 210,
"premium": 3.1,
"quantity": 1
},
{
"side": "short",
"type": "put",
"expiry": "2026-11-20",
"strike": 190,
"premium": 2.6,
"quantity": 2
},
{
"side": "long",
"type": "put",
"expiry": "2026-11-20",
"strike": 180,
"premium": 1.2,
"quantity": 2
}
],
"as_of": "2026-10-19",
"account": {
"type": "margin",
"equity": 50000,
"shares_held": 100,
"options_level": 3
},
"underlying": {
"price": 200,
"symbol": "AAPL"
}
}
],
"required": [
"account",
"underlying",
"legs"
],
"properties": {
"legs": {
"type": "array",
"items": {
"type": "object",
"required": [
"type",
"side",
"strike",
"expiry",
"quantity"
],
"properties": {
"side": {
"enum": [
"long",
"short"
]
},
"type": {
"enum": [
"call",
"put"
]
},
"vega": {
"type": "number"
},
"delta": {
"type": "number",
"description": "Per share, long-option sign convention."
},
"gamma": {
"type": "number"
},
"theta": {
"type": "number",
"description": "Per share per day."
},
"expiry": {
"type": "string",
"description": "YYYY-MM-DD"
},
"strike": {
"type": "number"
},
"premium": {
"type": "number",
"description": "Current option price per share."
},
"quantity": {
"type": "integer",
"description": "Contracts, positive."
},
"multiplier": {
"type": "number",
"description": "Default 100."
}
}
}
},
"as_of": {
"type": "string",
"description": "Date of the check (YYYY-MM-DD); defaults to today in New York."
},
"policy": {
"type": "object",
"description": "Overrides: pin_band_pct, max_requirement_pct_of_equity, max_delta_dollars_pct_of_equity, assignment_dte, low_extrinsic."
},
"account": {
"type": "object",
"required": [
"type",
"equity"
],
"properties": {
"cash": {
"type": "number",
"description": "Settled cash; cash accounts need it for cash-secured puts."
},
"type": {
"enum": [
"cash",
"margin"
]
},
"equity": {
"type": "number"
},
"shares_held": {
"type": "number",
"description": "Shares of the underlying held long (covers short calls)."
},
"buying_power": {
"type": "number",
"description": "Broker-reported option or stock buying power, if known."
},
"options_level": {
"type": "integer",
"description": "Approved level at the broker (typical scale 1 to 4)."
}
}
},
"api_key": {
"type": "string",
"description": "Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial."
},
"underlying": {
"type": "object",
"required": [
"symbol",
"price"
],
"properties": {
"price": {
"type": "number"
},
"symbol": {
"type": "string"
},
"dividend": {
"type": "number",
"description": "Dividend per share for that date."
},
"ex_dividend_date": {
"type": "string",
"description": "Next ex-dividend date (YYYY-MM-DD)."
}
}
}
}
}
}Send a planned trade, options position or portfolio and get a written decision memo: proceed, proceed with changes, or do not proceed, with the risks, the exact changes to make, the rules that apply and a dated note for your audit file. Runs pre_trade_check, position_size, tax_lot_plan, options_risk_check and portfolio_review on whichever sections you send, then Claude writes the memo; it never overrides a failed check. Paid only (credits or x402), except that each API key's first memo is free; the daily free calls and the anonymous trial don't cover it. Price: $0.1, paid only.
| Parameter | Type | Description |
|---|---|---|
| trade | object | A pre_trade_check request: {account, order, market?, policy?}. |
| sizing | object | A position_size request. |
| api_key | string | Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial. |
| context | string | Optional: your plan and thesis in plain words (up to 2000 characters). |
| options | object | An options_risk_check request. |
| tax_lots | object | A tax_lot_plan request, for a planned sale. |
| portfolio | object | A portfolio_review request. |
Free. Creates an API key for this agent (25 free calls a day, then prepaid credits) and attaches it to this MCP session, so the next calls use it automatically. Call this when the anonymous trial runs out. Save the key and add ?key=<key> to the MCP URL (or send Authorization: Bearer <key>) to keep using it in later sessions.
| Parameter | Type | Description |
|---|---|---|
| label | string | Optional name for the key, such as your agent's name. |
{
"name": "get_api_key",
"title": "Get a free API key",
"description": "Free. Creates an API key for this agent (25 free calls a day, then prepaid credits) and attaches it to this MCP session, so the next calls use it automatically. Call this when the anonymous trial runs out. Save the key and add ?key=<key> to the MCP URL (or send Authorization: Bearer <key>) to keep using it in later sessions.",
"inputSchema": {
"type": "object",
"properties": {
"label": {
"type": "string",
"description": "Optional name for the key, such as your agent's name."
}
}
}
}Free. Shows the API key's free calls left today and when they reset, prepaid credit balance, whether its one free advisor_memo is still available, and how to add credits.
| Parameter | Type | Description |
|---|---|---|
| api_key | string | Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial. |
{
"name": "my_account",
"title": "Check this agent's key",
"description": "Free. Shows the API key's free calls left today and when they reset, prepaid credit balance, whether its one free advisor_memo is still available, and how to add credits.",
"inputSchema": {
"type": "object",
"properties": {
"api_key": {
"type": "string",
"description": "Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial."
}
}
}
}# Agent Financial Advisor > The compliance officer, risk manager, tax advisor and performance auditor for AI agents that trade and advise. Call these before you act. Rule-based, deterministic, sourced to the regulation, and current (rules version 2026-10-18). ## Tools - **rules_digest** (free): Free. The current US trading, margin, settlement and tax rules an agent must follow, with effective dates and sources. Includes changes your training data may predate, such as the June 2026 replacement of the Pattern Day Trader rule. - **pre_trade_check** ($0.005/call): Run an order past a compliance officer and risk manager before sending it to the broker. Checks buying power, cash-account settlement violations, FINRA intraday margin (post-PDT) or legacy PDT limits, Reg SHO short-sale rules, wash-sale exposure, position concentration, per-trade risk versus stop, liquidity, spread, fat-finger prices, leverage and market hours. Returns approve / approve_with_warnings / reject with reasons and a resized quantity when useful. - **position_size** ($0.005/call): Size a position the way a risk manager would: fixed-fractional risk to a stop, volatility targeting (ATR or annualized vol), or fractional Kelly from your edge statistics. Applies a max-position cap and round lots, and explains the binding constraint. - **tax_lot_plan** ($0.02/call): Act as the tax advisor for a sale: compares FIFO, LIFO, HIFO and minimum-tax lot selection, splits short- and long-term gains, estimates tax, flags wash sales, and notes lots about to turn long-term. With mode=harvest it scans positions for tax-loss harvesting. - **portfolio_review** ($0.05/call): A periodic advisor review of a portfolio: weights, concentration (HHI and effective number of holdings), sector and asset-class exposure, drift from targets with the trades to rebalance, and, given return history, volatility, Sharpe, Sortino, drawdown, VaR/CVaR and beta. Ends with prioritized findings. - **strategy_audit** ($0.1/call): An independent performance auditor for a trading strategy or backtest. From a trade list and/or periodic returns it computes win rate, expectancy, profit factor, streaks, Sharpe/Sortino/drawdown, and tests whether the edge is real: t-stat, Probabilistic Sharpe Ratio and the Deflated Sharpe Ratio that corrects for how many variants you tried. Returns a verdict and red flags. - **suitability_check** ($0.03/call): The compliance review a robo-advisor or advisory agent should run before recommending a portfolio to a person: compares the proposal with the client's age, horizon, risk tolerance, liquidity needs and experience under Reg BI / fiduciary standards, flags complex products, and returns a timestamped, hashed suitability memo for the audit file. - **options_risk_check** ($0.01/call): Check an options book (existing or proposed legs) the way a broker's options desk would: covered, cash-secured, spread or naked; margin requirement under FINRA Rule 4210; cash-account limits; required approval level; early-assignment risk around ex-dividend dates; pin risk; auto-exercise of expiring in-the-money longs and the capital it needs; max loss; and net Greeks. Returns approve / approve_with_warnings / reject with reasons. - **advisor_memo** ($0.1/call, paid only): Send a planned trade, options position or portfolio and get a written decision memo: proceed, proceed with changes, or do not proceed, with the risks, the exact changes to make, the rules that apply and a dated note for your audit file. Runs pre_trade_check, position_size, tax_lot_plan, options_risk_check and portfolio_review on whichever sections you send, then Claude writes the memo; it never overrides a failed check. Paid only (credits or x402), except that each API key's first memo is free; the daily free calls and the anonymous trial don't cover it. ## Use - REST: POST https://agent-financial-advisor.agent-financial-advisor.workers.dev/v1/tools/{name} with a JSON body. Schemas: GET https://agent-financial-advisor.agent-f
Names, descriptions and schemas were written by the server and are shown as data.
Pattern matches on what the server declares. They show what it says it can do, not what it does.
| kelly: probability of a win (0-1). |
| annual_vol | number | volatility: annualized volatility of the asset (e.g. 0.35). |
| stop_price | number | Required when method is fixed_fractional: the protective stop price. |
| entry_price * | number |
| atr_multiple | number | volatility: stop distance in ATRs, default 2. |
| kelly_fraction | number | kelly: fraction of full Kelly to use, default 0.25. |
| allow_fractional | boolean |
| max_position_pct | number | Cap on position value / equity, default 0.2. |
| target_annual_vol_contribution | number | volatility: target vol contribution as fraction of equity, default 0.02. |
{
"name": "position_size",
"title": "Position sizing",
"description": "Size a position the way a risk manager would: fixed-fractional risk to a stop, volatility targeting (ATR or annualized vol), or fractional Kelly from your edge statistics. Applies a max-position cap and round lots, and explains the binding constraint. Price: $0.005.",
"inputSchema": {
"type": "object",
"examples": [
{
"equity": 50000,
"method": "fixed_fractional",
"risk_pct": 0.01,
"stop_price": 95,
"entry_price": 100
}
],
"required": [
"equity",
"entry_price",
"method"
],
"properties": {
"atr": {
"type": "number",
"description": "volatility: average true range in price units."
},
"side": {
"enum": [
"long",
"short"
],
"default": "long"
},
"equity": {
"type": "number"
},
"method": {
"enum": [
"fixed_fractional",
"volatility",
"kelly"
]
},
"api_key": {
"type": "string",
"description": "Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial."
},
"avg_win": {
"type": "number",
"description": "kelly: average win (any unit, same as avg_loss)."
},
"avg_loss": {
"type": "number",
"description": "kelly: average loss as a positive number."
},
"lot_size": {
"type": "integer",
"description": "Round down to this multiple, default 1."
},
"risk_pct": {
"type": "number",
"description": "fixed_fractional: fraction of equity to risk, default 0.01."
},
"win_rate": {
"type": "number",
"description": "kelly: probability of a win (0-1)."
},
"annual_vol": {
"type": "number",
"description": "volatility: annualized volatility of the asset (e.g. 0.35)."
},
"stop_price": {
"type": "number",
"description": "Required when method is fixed_fractional: the protective stop price."
},
"entry_price": {
"type": "number"
},
"atr_multiple": {
"type": "number",
"description": "volatility: stop distance in ATRs, default 2."
},
"kelly_fraction": {
"type": "number",
"description": "kelly: fraction of full Kelly to use, default 0.25."
},
"allow_fractional": {
"type": "boolean"
},
"max_position_pct": {
"type": "number",
"description": "Cap on position value / equity, default 0.2."
},
"target_annual_vol_contribution": {
"type": "number",
"description": "volatility: target vol contribution as fraction of equity, default 0.02."
}
}
}
}{
"name": "tax_lot_plan",
"title": "Tax lot selection and wash-sale check",
"description": "Act as the tax advisor for a sale: compares FIFO, LIFO, HIFO and minimum-tax lot selection, splits short- and long-term gains, estimates tax, flags wash sales, and notes lots about to turn long-term. With mode=harvest it scans positions for tax-loss harvesting. Price: $0.02.",
"inputSchema": {
"type": "object",
"examples": [
{
"lots": [
{
"lot_id": "a",
"quantity": 10,
"acquired_date": "2024-01-10",
"cost_basis_per_share": 200
},
{
"lot_id": "b",
"quantity": 10,
"acquired_date": "2026-09-01",
"cost_basis_per_share": 450
}
],
"sell": {
"date": "2026-10-12",
"price": 420,
"quantity": 10
},
"symbol": "MSFT"
}
],
"required": [
"lots"
],
"properties": {
"lots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"lot_id": {
"type": "string"
},
"symbol": {
"type": "string"
},
"quantity": {
"type": "number"
},
"acquired_date": {
"type": "string"
},
"cost_basis_per_share": {
"type": "number"
}
}
}
},
"mode": {
"enum": [
"sell",
"harvest"
],
"default": "sell"
},
"sell": {
"type": "object",
"properties": {
"date": {
"type": "string"
},
"price": {
"type": "number"
},
"quantity": {
"type": "number"
}
},
"description": "mode=sell"
},
"as_of": {
"type": "string",
"description": "mode=harvest: date, default today"
},
"prices": {
"type": "object",
"description": "mode=harvest: {SYMBOL: current price}"
},
"symbol": {
"type": "string"
},
"api_key": {
"type": "string",
"description": "Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial."
},
"tax_rates": {
"type": "object",
"properties": {
"long_term": {
"type": "number"
},
"short_term": {
"type": "number"
}
}
},
"min_harvest_loss": {
"type": "number",
"description": "mode=harvest: ignore losses smaller than this (USD), default 100."
},
"recent_transactions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"date": {
"type": "string"
},
"side": {
"enum": [
"buy",
"sell"
]
},
"symbol": {
"type": "string"
},
"quantity": {
"type": "number"
}
}
}
}
}
}
}{
"name": "portfolio_review",
"title": "Portfolio review",
"description": "A periodic advisor review of a portfolio: weights, concentration (HHI and effective number of holdings), sector and asset-class exposure, drift from targets with the trades to rebalance, and, given return history, volatility, Sharpe, Sortino, drawdown, VaR/CVaR and beta. Ends with prioritized findings. Price: $0.05.",
"inputSchema": {
"type": "object",
"examples": [
{
"cash": 10000,
"targets": {
"cash": 0.05,
"bonds": 0.35,
"equity": 0.6
},
"holdings": [
{
"value": 60000,
"sector": "Tech",
"symbol": "NVDA",
"asset_class": "equity"
},
{
"value": 30000,
"symbol": "AGG",
"asset_class": "bonds"
}
]
}
],
"required": [
"holdings"
],
"properties": {
"cash": {
"type": "number"
},
"limits": {
"type": "object",
"properties": {
"max_drawdown": {
"type": "number"
},
"max_sector_weight": {
"type": "number"
},
"max_single_weight": {
"type": "number"
}
}
},
"api_key": {
"type": "string",
"description": "Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial."
},
"returns": {
"type": "array",
"items": {
"type": "number"
},
"description": "Periodic portfolio returns as decimals."
},
"targets": {
"type": "object",
"description": "Target weights by symbol or asset_class, summing to 1."
},
"holdings": {
"type": "array",
"items": {
"type": "object",
"properties": {
"price": {
"type": "number"
},
"value": {
"type": "number"
},
"sector": {
"type": "string"
},
"symbol": {
"type": "string"
},
"quantity": {
"type": "number"
},
"asset_class": {
"type": "string"
}
}
}
},
"rebalance_band": {
"type": "number",
"description": "Absolute drift that triggers a rebalance, default 0.05."
},
"risk_free_rate": {
"type": "number",
"default": 0
},
"periods_per_year": {
"type": "number",
"default": 252
},
"benchmark_returns": {
"type": "array",
"items": {
"type": "number"
}
}
}
}
}{
"name": "strategy_audit",
"title": "Strategy audit and overfitting check",
"description": "An independent performance auditor for a trading strategy or backtest. From a trade list and/or periodic returns it computes win rate, expectancy, profit factor, streaks, Sharpe/Sortino/drawdown, and tests whether the edge is real: t-stat, Probabilistic Sharpe Ratio and the Deflated Sharpe Ratio that corrects for how many variants you tried. Returns a verdict and red flags. Price: $0.1.",
"inputSchema": {
"type": "object",
"examples": [
{
"trades": [
{
"pnl": 120
},
{
"pnl": -60
},
{
"pnl": 45
},
{
"pnl": -30
},
{
"pnl": 90
}
],
"n_trials": 20
}
],
"properties": {
"trades": {
"type": "array",
"items": {
"type": "object",
"properties": {
"pnl": {
"type": "number"
},
"return_pct": {
"type": "number"
}
}
},
"description": "Closed trades."
},
"api_key": {
"type": "string",
"description": "Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial."
},
"returns": {
"type": "array",
"items": {
"type": "number"
},
"description": "Periodic strategy returns as decimals."
},
"n_trials": {
"type": "integer",
"default": 1,
"description": "How many strategy/parameter variants were tested before picking this one. Default 1."
},
"starting_equity": {
"type": "number",
"description": "For risk-of-ruin and drawdown in dollars from trades."
},
"periods_per_year": {
"type": "number",
"default": 252
},
"avg_trial_correlation": {
"type": "number",
"description": "Average pairwise correlation (0 to 1) between the returns of the variants you tested. Near-duplicate variants (a 20-day vs. 21-day lookback) are not independent trials; with this the audit deflates by an effective trial count instead of the raw n_trials."
},
"trial_sharpe_variance": {
"type": "number",
"description": "Variance of per-period Sharpe across trials, if known."
}
}
}
}{
"name": "advisor_memo",
"title": "Advisor memo (written by Claude)",
"description": "Send a planned trade, options position or portfolio and get a written decision memo: proceed, proceed with changes, or do not proceed, with the risks, the exact changes to make, the rules that apply and a dated note for your audit file. Runs pre_trade_check, position_size, tax_lot_plan, options_risk_check and portfolio_review on whichever sections you send, then Claude writes the memo; it never overrides a failed check. Paid only (credits or x402), except that each API key's first memo is free; the daily free calls and the anonymous trial don't cover it. Price: $0.1, paid only.",
"inputSchema": {
"type": "object",
"examples": [
{
"trade": {
"order": {
"side": "buy",
"symbol": "AAPL",
"quantity": 50,
"limit_price": 200,
"stop_loss_price": 190
},
"market": {
"ask": 200.02,
"bid": 199.98,
"last_price": 200,
"avg_daily_volume": 50000000
},
"account": {
"type": "margin",
"equity": 100000,
"positions": []
}
},
"context": "Momentum entry on AAPL after earnings; plan to hold 2 to 6 weeks."
}
],
"properties": {
"trade": {
"type": "object",
"description": "A pre_trade_check request: {account, order, market?, policy?}."
},
"sizing": {
"type": "object",
"description": "A position_size request."
},
"api_key": {
"type": "string",
"description": "Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial."
},
"context": {
"type": "string",
"description": "Optional: your plan and thesis in plain words (up to 2000 characters)."
},
"options": {
"type": "object",
"description": "An options_risk_check request."
},
"tax_lots": {
"type": "object",
"description": "A tax_lot_plan request, for a planned sale."
},
"portfolio": {
"type": "object",
"description": "A portfolio_review request."
}
}
}
}