# 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-financial-advisor.workers.dev/v1/tools, OpenAPI: https://agent-financial-advisor.agent-financial-advisor.workers.dev/openapi.json
- MCP (streamable HTTP): https://agent-financial-advisor.agent-financial-advisor.workers.dev/mcp
- Start here: call pre_trade_check before every order. Each tool's input schema carries a worked example (GET /v1/tools, or tools/list over MCP).
- Try before you build: call any priced tool with empty input ({}) and it returns a free demo, the worked example with its full output.
- Free trial: a few calls a day without a key. A free API key adds 25 free calls a day: over MCP, call the get_api_key tool, then pass the key as the api_key argument on each tool call; over REST, POST /v1/keys and send Authorization: Bearer <key>. URL-only MCP clients can also use /mcp?key=<key>.
- Each API key's first advisor_memo is free. Check what a key has left with the my_account MCP tool or GET /v1/keys/me.
- Pay per call with x402 (USDC on Base; minimum $0.01 per call), or prepay credits at list price: POST /v1/credits?pack=5|20|100 (packs of $20 and $100 include 10% and 20% bonus credit).
- Compliance records: every paid call made with an API key is logged in a hash-chained, signed audit log (GET /v1/audit, POST /v1/audit/verify).

Outputs are automated analysis for software agents, not personalized investment, tax or legal advice.