Jump to content

IdiotProof/MCP TOOLS/part 3

From MindAttic Docs
Part 3 of 3: 1 · 2 · 3
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Why a strategy did or didn\u0027t fire: its recent gate verdicts (conditions met, LLM veto, Risk Guardian block, order placed or rejected) and where it stands now.",
  "properties": {
    "strategy": {
      "type": "string",
      "description": "Id, id prefix, stamp id or symbol.",
      "default": ""
    },
    "limit": {
      "type": "integer",
      "description": "How many verdicts to show (default 20, max 200).",
      "default": 20
    }
  },
  "additionalProperties": false,
  "required": [
    "strategy"
  ]
}

strategy_from_text

Turn a plain-English description into a strategy (via the LLM), show its stamp, and save it only when you confirm.

The first call writes the IdiotScript, validates it and shows the stamp with a confirmation code; nothing is saved. A script that does not validate is repaired: spelling and punctuation fixes that leave a fully valid script are applied directly, anything else goes back to the LLM with its errors for at most llm.repair.rounds more calls (default 2). The result's repair says what was corrected; a script that never validates is refused with its last errors. Re-run with --confirm to save exactly what was shown (the LLM is not called again). It saves inactive, in Sandbox by default, 1 share when unsized.

CLI equivalent: idiotproof strategy from-text <description> [--ticker <string>] [--mode <sandbox|paper|live>] [--title <string>] Examples: idiotproof strategy from-text "Buy NVDA when it reclaims VWAP with volume, stop 2% under, take profit at 190" idiotproof strategy from-text "long on a 9 EMA reclaim above VWAP, 3% stop" --ticker AMD --mode paper

Changes saved state. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Turn a plain-English description into a strategy (via the LLM), show its stamp, and save it only when you confirm.",
  "properties": {
    "description": {
      "type": "string",
      "description": "The strategy in plain English (\u0060-\u0060 reads stdin).",
      "default": ""
    },
    "ticker": {
      "type": "string",
      "description": "The symbol to trade (default: the first ticker-looking word, e.g. $NVDA or NVDA)."
    },
    "mode": {
      "type": "string",
      "enum": [
        "sandbox",
        "paper",
        "live"
      ],
      "description": "Broker mode for the saved strategy: sandbox (default) or paper.",
      "default": "sandbox"
    },
    "title": {
      "type": "string",
      "description": "Title for the saved strategy (default: its own name, else \u0022SYM strategy\u0022)."
    }
  },
  "additionalProperties": false,
  "required": [
    "description"
  ]
}

strategy_from_watchlist

Create one strategy per item of a watchlist JSON file (the Monitor's create-strategies, through the CLI).

Each item's script is validated like strategy create; an item that fails is reported and skipped. Items already present (same symbol and title) or repeated in the file are skipped, so re-running is safe. New strategies start inactive in Sandbox with 1 share when unsized; --activate turns on the items marked active.

CLI equivalent: idiotproof strategy from-watchlist <file> [--mode <sandbox|paper|live>] [--activate] [--dry-run] Examples: idiotproof strategy from-watchlist D:/watchlists/2026-10-30.json idiotproof strategy from-watchlist - idiotproof strategy from-watchlist - --mode paper --activate --dry-run

Changes saved state. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Create one strategy per item of a watchlist JSON file (the Monitor\u0027s create-strategies, through the CLI).",
  "properties": {
    "file": {
      "type": "string",
      "description": "A watchlist JSON file (absolute path: the Hub reads it), the JSON itself, or \u0060-\u0060 for stdin: [{\u0022title\u0022,\u0022symbol\u0022,\u0022script\u0022,\u0022description\u0022,\u0022author\u0022,\u0022originTranscript\u0022,\u0022active\u0022}].",
      "default": ""
    },
    "mode": {
      "type": "string",
      "enum": [
        "sandbox",
        "paper",
        "live"
      ],
      "description": "Broker mode for every new strategy: sandbox (default) or paper.",
      "default": "sandbox"
    },
    "activate": {
      "type": "boolean",
      "description": "Activate items marked \u0022active\u0022: true (default: everything starts inactive).",
      "default": false
    },
    "dry_run": {
      "type": "boolean",
      "description": "Validate every item and report what would happen without saving.",
      "default": false
    }
  },
  "additionalProperties": false,
  "required": [
    "file"
  ]
}

strategy_history

A strategy's trail, newest first: Monitor verdicts and fills, diary trades, and the CLI/MCP commands that touched it.

CLI equivalent: idiotproof strategy history <strategy> [--limit <int>] Examples: idiotproof strategy history NVDA idiotproof strategy history NVDA --limit 100

Read-only. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "A strategy\u0027s trail, newest first: Monitor verdicts and fills, diary trades, and the CLI/MCP commands that touched it.",
  "properties": {
    "strategy": {
      "type": "string",
      "description": "Id, id prefix, stamp id or symbol.",
      "default": ""
    },
    "limit": {
      "type": "integer",
      "description": "How many events to show (default 40, max 500).",
      "default": 40
    }
  },
  "additionalProperties": false,
  "required": [
    "strategy"
  ]
}

strategy_import

Create a strategy from a stamp, canonical JSON or IdiotScript. It starts inactive in Sandbox.

CLI equivalent: idiotproof strategy import <source> [--title <string>] [--mode <sandbox|paper|live>] Examples: idiotproof strategy import - idiotproof strategy import "Ticker("NVDA").IsAboveVwap().StopLoss(2)" --mode paper

Changes saved state. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Create a strategy from a stamp, canonical JSON or IdiotScript. It starts inactive in Sandbox.",
  "properties": {
    "source": {
      "type": "string",
      "description": "A pasted stamp/armor/IPS1 payload, canonical JSON, or IdiotScript text (\u0060-\u0060 reads stdin).",
      "default": ""
    },
    "title": {
      "type": "string",
      "description": "Title for the new strategy (default: the strategy\u0027s own name or symbol)."
    },
    "mode": {
      "type": "string",
      "enum": [
        "sandbox",
        "paper",
        "live"
      ],
      "description": "Broker mode for the new strategy: sandbox (default) or paper. Live is a separate, confirmed step.",
      "default": "sandbox"
    }
  },
  "additionalProperties": false,
  "required": [
    "source"
  ]
}

strategy_list

List your strategies with mode, position and live condition progress.

CLI equivalent: idiotproof strategy list [--active] [--symbol <string>] [--mode <sandbox|paper|live>] [--deleted] [--kind <string>] Examples: idiotproof strategy list idiotproof strategy list --active --mode live idiotproof strategy list --kind gapper --mode paper --json

Read-only. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "List your strategies with mode, position and live condition progress.",
  "properties": {
    "active": {
      "type": "boolean",
      "description": "Only strategies the Monitor is evaluating.",
      "default": false
    },
    "symbol": {
      "type": "string",
      "description": "Only this symbol."
    },
    "mode": {
      "type": "string",
      "enum": [
        "sandbox",
        "paper",
        "live"
      ],
      "description": "Only this broker mode (sandbox, paper, live)."
    },
    "deleted": {
      "type": "boolean",
      "description": "Include soft-deleted strategies (hidden by default).",
      "default": false
    },
    "kind": {
      "type": "string",
      "description": "Only strategies of this kind (gapper, momentum, exhaustion, or any kind given at create); case-insensitive. \u0060none\u0060 lists the ones with no kind."
    }
  },
  "additionalProperties": false
}

strategy_mode

Route a strategy to sandbox, paper or live. Switching to live needs a confirmation code.

CLI equivalent: idiotproof strategy mode <strategy> <mode> Examples: idiotproof strategy mode NVDA paper idiotproof strategy mode NVDA live

MOVES MONEY. Sandbox and Paper run immediately. A Live action returns status confirmation-required with a preview and a code instead of executing: show the user the preview verbatim, ask them, and only if they say yes call this tool again with the identical arguments plus confirmation_code. Never invent or reuse a code. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Route a strategy to sandbox, paper or live. Switching to live needs a confirmation code.",
  "properties": {
    "strategy": {
      "type": "string",
      "description": "Id, id prefix, stamp id or symbol.",
      "default": ""
    },
    "mode": {
      "type": "string",
      "enum": [
        "sandbox",
        "paper",
        "live"
      ],
      "description": "sandbox, paper or live (live needs a confirmation code).",
      "default": "sandbox"
    },
    "confirmation_code": {
      "type": "string",
      "description": "Only after the user explicitly approves the preview: the code a previous call of this tool returned."
    }
  },
  "additionalProperties": false,
  "required": [
    "strategy",
    "mode"
  ]
}

strategy_progress

How close a strategy is to firing: conditions passing N/M, the first failing verb and the last price, optionally watched.

Reads the row the Monitor writes every tick. --watch samples it every --every seconds and reports each change, stopping when every condition passes: in a terminal each change streams live until Ctrl+C; for MCP and --json it takes --samples samples (at most two minutes in all).

CLI equivalent: idiotproof strategy progress <strategy> [--watch] [--every <int>] [--samples <int>] Examples: idiotproof strategy progress NVDA idiotproof strategy progress NVDA --watch --every 10 --samples 6

Read-only. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "How close a strategy is to firing: conditions passing N/M, the first failing verb and the last price, optionally watched.",
  "properties": {
    "strategy": {
      "type": "string",
      "description": "Id, id prefix, stamp id or symbol.",
      "default": ""
    },
    "watch": {
      "type": "boolean",
      "description": "Keep sampling the Monitor\u0027s progress row and report each change: a terminal streams until Ctrl\u002BC or all conditions pass; MCP/--json are bounded by --samples.",
      "default": false
    },
    "every": {
      "type": "integer",
      "description": "Seconds between samples while watching (0-60, default 5).",
      "default": 5
    },
    "samples": {
      "type": "integer",
      "description": "How many samples to take while watching (1-120; default 12 for MCP/--json, unlimited in a terminal)."
    }
  },
  "additionalProperties": false,
  "required": [
    "strategy"
  ]
}

strategy_quarantine

List strategies the Monitor refuses to evaluate (canon unreadable, or no canon and a script that doesn't parse), with the reason, why each was not repaired automatically, and the proposed repair.

A quarantined strategy never fires; one that is quarantined while holding a position has NO managed exit and is listed first. The Monitor repairs a quarantined strategy by itself only when it is active, flat, at step 1 of its sequence, Paper or Sandbox (Live needs quarantine.autorepair.live), its script has no errors, and the canon re-derived from the script loses nothing the stored canon expressed. Everything else is listed here with what blocks it. This command changes nothing; --diff shows the canon a repair would write.

CLI equivalent: idiotproof strategy quarantine [--symbol <string>] [--diff] Examples: idiotproof strategy quarantine idiotproof strategy quarantine --symbol NVDA --diff

Read-only. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "List strategies the Monitor refuses to evaluate (canon unreadable, or no canon and a script that doesn\u0027t parse), with the reason, why each was not repaired automatically, and the proposed repair.",
  "properties": {
    "symbol": {
      "type": "string",
      "description": "Only this symbol."
    },
    "diff": {
      "type": "boolean",
      "description": "Also print each proposed repair as a line diff of the stored canon against the canon re-derived from the script.",
      "default": false
    }
  },
  "additionalProperties": false
}

strategy_rename

Give a strategy a new title. Its canon, stamp id and state are untouched.

Only the title changes, so the stamp id stays the same. The Monitor's audit lines carry the title at the time, so strategy history matches the new title from now on.

CLI equivalent: idiotproof strategy rename <strategy> <title> Examples: idiotproof strategy rename NVDA "NVDA VWAP reclaim"

Changes saved state. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Give a strategy a new title. Its canon, stamp id and state are untouched.",
  "properties": {
    "strategy": {
      "type": "string",
      "description": "Id, id prefix, stamp id or symbol.",
      "default": ""
    },
    "title": {
      "type": "string",
      "description": "The new title (1-200 characters).",
      "default": ""
    }
  },
  "additionalProperties": false,
  "required": [
    "strategy",
    "title"
  ]
}

strategy_resync_canon

Re-derive your strategies' canons from their scripts where the script now yields a richer canon; dry run unless --apply.

The repair for verbs an older parser dropped silently. A row is rewritten only when the re-derived canon has at least as many entry conditions and branches as the stored one; anything that would lose a condition is skipped and reported. Only the canon (ScriptJson) changes — position bookkeeping is untouched.

CLI equivalent: idiotproof strategy resync-canon [--apply] Examples: idiotproof strategy resync-canon idiotproof strategy resync-canon --apply

Changes saved state. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Re-derive your strategies\u0027 canons from their scripts where the script now yields a richer canon; dry run unless --apply.",
  "properties": {
    "apply": {
      "type": "boolean",
      "description": "Write the repaired canons (default is a dry run that changes nothing).",
      "default": false
    }
  },
  "additionalProperties": false
}

strategy_samples

List the built-in sample strategies, or show one as IdiotScript, a stamp or canonical JSON.

Samples are worked examples you can save and edit: idiotproof strategy samples vwap-reclaim --format json | idiotproof strategy create --canon -.

CLI equivalent: idiotproof strategy samples [<name>] [--format <stamp|armor|json|script>] Examples: idiotproof strategy samples idiotproof strategy samples vwap-reclaim idiotproof strategy samples sune-wedge --format stamp

Read-only. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "List the built-in sample strategies, or show one as IdiotScript, a stamp or canonical JSON.",
  "properties": {
    "name": {
      "type": "string",
      "description": "A sample\u0027s name to show in full (omit to list them all)."
    },
    "format": {
      "type": "string",
      "enum": [
        "stamp",
        "armor",
        "json",
        "script"
      ],
      "description": "How to show one sample: script (default), stamp or json.",
      "default": "script"
    }
  },
  "additionalProperties": false
}

strategy_set

Edit a strategy's stop, target, trailing, size, sell-by time or session; the canon is rewritten and re-validated.

Only the named fields change. The result must still validate (a stop, stop below target on a long, ...). A Live strategy needs a confirmation code bound to exactly these changes.

CLI equivalent: idiotproof strategy set <strategy> [--stop <decimal>] [--stop-percent <decimal>] [--target <decimal>] [--target-percent <decimal>] [--trailing <decimal>] [--giveback <decimal>] [--qty <int>] [--notional <decimal>] [--sell-by <string>] [--session <premarket|rth|after-hours|extended>] Examples: idiotproof strategy set NVDA --stop 168.5 --target 195 idiotproof strategy set NVDA --qty 2 --sell-by 15:45

MOVES MONEY. Sandbox and Paper run immediately. A Live action returns status confirmation-required with a preview and a code instead of executing: show the user the preview verbatim, ask them, and only if they say yes call this tool again with the identical arguments plus confirmation_code. Never invent or reuse a code. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Edit a strategy\u0027s stop, target, trailing, size, sell-by time or session; the canon is rewritten and re-validated.",
  "properties": {
    "strategy": {
      "type": "string",
      "description": "Id, id prefix, stamp id or symbol.",
      "default": ""
    },
    "stop": {
      "type": "number",
      "description": "Stop-loss price (replaces a percent stop)."
    },
    "stop_percent": {
      "type": "number",
      "description": "Stop-loss percent from the fill (replaces a price stop)."
    },
    "target": {
      "type": "number",
      "description": "Take-profit price (replaces a percent target and any scale-out ladder)."
    },
    "target_percent": {
      "type": "number",
      "description": "Take-profit percent from the fill (replaces a price target)."
    },
    "trailing": {
      "type": "number",
      "description": "Trailing-stop percent; 0 removes it."
    },
    "giveback": {
      "type": "number",
      "description": "Peak-giveback exit percent; 0 removes it."
    },
    "qty": {
      "type": "integer",
      "description": "Share quantity per entry (replaces a notional size)."
    },
    "notional": {
      "type": "number",
      "description": "Dollar size per entry (replaces a share quantity)."
    },
    "sell_by": {
      "type": "string",
      "description": "Sell anything still held at this ET time (HH:mm); \u0022none\u0022 removes it."
    },
    "session": {
      "type": "string",
      "enum": [
        "premarket",
        "rth",
        "after-hours",
        "extended"
      ],
      "description": "Trading session: premarket, rth, afterhours or extended."
    },
    "confirmation_code": {
      "type": "string",
      "description": "Only after the user explicitly approves the preview: the code a previous call of this tool returned."
    }
  },
  "additionalProperties": false,
  "required": [
    "strategy"
  ]
}

strategy_show

Everything about one strategy: settings, script, position, progress.

CLI equivalent: idiotproof strategy show <strategy> Examples: idiotproof strategy show NVDA idiotproof strategy show IP-P4AY-UXZU

Read-only. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Everything about one strategy: settings, script, position, progress.",
  "properties": {
    "strategy": {
      "type": "string",
      "description": "Id, id prefix, stamp id (IP-XXXX-XXXX) or symbol.",
      "default": ""
    }
  },
  "additionalProperties": false,
  "required": [
    "strategy"
  ]
}

strategy_stamp

Print the strategy's ASCII stamp: header, phase flow, exit ladder, fingerprint and a paste-back payload.

CLI equivalent: idiotproof strategy stamp <strategy> [--unicode] [--qr] [--compact] Examples: idiotproof strategy stamp NVDA idiotproof strategy stamp IP-P4AY-UXZU --unicode --qr

Read-only. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Print the strategy\u0027s ASCII stamp: header, phase flow, exit ladder, fingerprint and a paste-back payload.",
  "properties": {
    "strategy": {
      "type": "string",
      "description": "Id, id prefix, stamp id or symbol.",
      "default": ""
    },
    "unicode": {
      "type": "boolean",
      "description": "Box-drawing characters instead of plain ASCII.",
      "default": false
    },
    "qr": {
      "type": "boolean",
      "description": "Add a terminal QR code of the payload.",
      "default": false
    },
    "compact": {
      "type": "boolean",
      "description": "Leave out the armored payload block (picture only).",
      "default": false
    }
  },
  "additionalProperties": false,
  "required": [
    "strategy"
  ]
}

strategy_step

Where a sequenced strategy stands (step k/N, armed or awaiting its transition); --reset starts it over at step 1.

CLI equivalent: idiotproof strategy step <strategy> [--reset] Examples: idiotproof strategy step NVDA idiotproof strategy step NVDA --reset

Changes saved state. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Where a sequenced strategy stands (step k/N, armed or awaiting its transition); --reset starts it over at step 1.",
  "properties": {
    "strategy": {
      "type": "string",
      "description": "Id, id prefix, stamp id (IP-XXXX-XXXX) or symbol.",
      "default": ""
    },
    "reset": {
      "type": "boolean",
      "description": "Put the sequence back at step 1 (refused while it holds a position).",
      "default": false
    }
  },
  "additionalProperties": false,
  "required": [
    "strategy"
  ]
}

strategy_validate

Check a saved strategy or a script: parse, canon round-trip, phase rules and a risk preview. Changes nothing.

CLI equivalent: idiotproof strategy validate [<strategy>] [--script <string>] [--canon <string>] Examples: idiotproof strategy validate NVDA idiotproof strategy validate --script "Stock.Ticker("AMD").IsAboveVwap().Long().StopLoss(150).Build()"

Read-only. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Check a saved strategy or a script: parse, canon round-trip, phase rules and a risk preview. Changes nothing.",
  "properties": {
    "strategy": {
      "type": "string",
      "description": "Id, id prefix, stamp id or symbol of a saved strategy (omit with --script/--canon)."
    },
    "script": {
      "type": "string",
      "description": "Validate this IdiotScript text instead of a saved strategy (\u0060-\u0060 reads stdin)."
    },
    "canon": {
      "type": "string",
      "description": "Validate this canonical JSON instead of a saved strategy (\u0060-\u0060 reads stdin)."
    }
  },
  "additionalProperties": false
}

trade_buy

Buy shares (open or add to a long). Sandbox by default; live needs a confirmation code.

CLI equivalent: idiotproof trade buy <symbol> [<qty>] [--dollars <decimal>] [--limit <decimal>] [--stop <decimal>] [--target <decimal>] [--mode <sandbox|paper|live>] [--ext] [--tif <string>] [--note <string>] Examples: idiotproof trade buy NVDA 10 --limit 131.20 --stop 127.50 idiotproof trade buy AAPL --dollars 500 --stop 220 --mode paper idiotproof trade buy GAPT 100 --limit 4.12 --stop 3.90 --ext --mode live

MOVES MONEY. Sandbox and Paper run immediately. A Live action returns status confirmation-required with a preview and a code instead of executing: show the user the preview verbatim, ask them, and only if they say yes call this tool again with the identical arguments plus confirmation_code. Never invent or reuse a code. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Buy shares (open or add to a long). Sandbox by default; live needs a confirmation code.",
  "properties": {
    "symbol": {
      "type": "string",
      "description": "Ticker, e.g. NVDA.",
      "default": ""
    },
    "qty": {
      "type": "integer",
      "description": "Shares. Leave out and pass --dollars to size by amount."
    },
    "dollars": {
      "type": "number",
      "description": "Size by dollar amount instead of shares (fractional, regular hours only)."
    },
    "limit": {
      "type": "number",
      "description": "Limit price. Without it the order is a market order."
    },
    "stop": {
      "type": "number",
      "description": "Protective stop price for an entry; the Risk Guardian refuses entries without one."
    },
    "target": {
      "type": "number",
      "description": "Take-profit price (for the reward:risk check)."
    },
    "mode": {
      "type": "string",
      "enum": [
        "sandbox",
        "paper",
        "live"
      ],
      "description": "Where it routes: sandbox (simulator, the default), paper, or live (needs confirmation).",
      "default": "sandbox"
    },
    "ext": {
      "type": "boolean",
      "description": "Extended hours (premarket/after-hours); requires --limit, DAY.",
      "default": false
    },
    "tif": {
      "type": "string",
      "description": "Time in force: day (default) or gtc.",
      "default": "day"
    },
    "note": {
      "type": "string",
      "description": "Why \u2014 kept in the audit trail."
    },
    "confirmation_code": {
      "type": "string",
      "description": "Only after the user explicitly approves the preview: the code a previous call of this tool returned."
    }
  },
  "additionalProperties": false,
  "required": [
    "symbol"
  ]
}

trade_confirm

Execute a pending Live order by its confirmation code (exactly what was previewed, once).

CLI equivalent: idiotproof trade confirm Examples: idiotproof trade confirm K7Q2ZP

MOVES MONEY. Sandbox and Paper run immediately. A Live action returns status confirmation-required with a preview and a code instead of executing: show the user the preview verbatim, ask them, and only if they say yes call this tool again with the identical arguments plus confirmation_code. Never invent or reuse a code. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Execute a pending Live order by its confirmation code (exactly what was previewed, once).",
  "properties": {
    "code": {
      "type": "string",
      "description": "The six-character code a Live preview returned.",
      "default": ""
    },
    "confirmation_code": {
      "type": "string",
      "description": "Only after the user explicitly approves the preview: the code a previous call of this tool returned."
    }
  },
  "additionalProperties": false,
  "required": [
    "code"
  ]
}

trade_cover

Buy to cover a short.

CLI equivalent: idiotproof trade cover <symbol> [<qty>] [--dollars <decimal>] [--limit <decimal>] [--stop <decimal>] [--target <decimal>] [--mode <sandbox|paper|live>] [--ext] [--tif <string>] [--note <string>] Examples: idiotproof trade cover TSLA 5 --mode paper

MOVES MONEY. Sandbox and Paper run immediately. A Live action returns status confirmation-required with a preview and a code instead of executing: show the user the preview verbatim, ask them, and only if they say yes call this tool again with the identical arguments plus confirmation_code. Never invent or reuse a code. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Buy to cover a short.",
  "properties": {
    "symbol": {
      "type": "string",
      "description": "Ticker, e.g. NVDA.",
      "default": ""
    },
    "qty": {
      "type": "integer",
      "description": "Shares. Leave out and pass --dollars to size by amount."
    },
    "dollars": {
      "type": "number",
      "description": "Size by dollar amount instead of shares (fractional, regular hours only)."
    },
    "limit": {
      "type": "number",
      "description": "Limit price. Without it the order is a market order."
    },
    "stop": {
      "type": "number",
      "description": "Protective stop price for an entry; the Risk Guardian refuses entries without one."
    },
    "target": {
      "type": "number",
      "description": "Take-profit price (for the reward:risk check)."
    },
    "mode": {
      "type": "string",
      "enum": [
        "sandbox",
        "paper",
        "live"
      ],
      "description": "Where it routes: sandbox (simulator, the default), paper, or live (needs confirmation).",
      "default": "sandbox"
    },
    "ext": {
      "type": "boolean",
      "description": "Extended hours (premarket/after-hours); requires --limit, DAY.",
      "default": false
    },
    "tif": {
      "type": "string",
      "description": "Time in force: day (default) or gtc.",
      "default": "day"
    },
    "note": {
      "type": "string",
      "description": "Why \u2014 kept in the audit trail."
    },
    "confirmation_code": {
      "type": "string",
      "description": "Only after the user explicitly approves the preview: the code a previous call of this tool returned."
    }
  },
  "additionalProperties": false,
  "required": [
    "symbol"
  ]
}

trade_flatten

Flatten a symbol, a strategy's position, or the whole account with market exits through the TransactionGateway. Live needs a confirmation code.

CLI equivalent: idiotproof trade flatten [--symbol <string>] [--strategy <string>] [--all] [--mode <sandbox|paper|live>] [--preview] Examples: idiotproof trade flatten --symbol HIHO --mode paper idiotproof trade flatten --strategy IP-P4AY-UXZU idiotproof trade flatten --all --mode live --preview

MOVES MONEY. Sandbox and Paper run immediately. A Live action returns status confirmation-required with a preview and a code instead of executing: show the user the preview verbatim, ask them, and only if they say yes call this tool again with the identical arguments plus confirmation_code. Never invent or reuse a code. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Flatten a symbol, a strategy\u0027s position, or the whole account with market exits through the TransactionGateway. Live needs a confirmation code.",
  "properties": {
    "symbol": {
      "type": "string",
      "description": "Close the whole broker position in this symbol."
    },
    "strategy": {
      "type": "string",
      "description": "Close what this strategy books (id, id prefix, stamp id or symbol), capped at what the broker holds."
    },
    "all": {
      "type": "boolean",
      "description": "Close every position in the account.",
      "default": false
    },
    "mode": {
      "type": "string",
      "enum": [
        "sandbox",
        "paper",
        "live"
      ],
      "description": "paper or live (live needs a confirmation code). Default: the strategy\u0027s mode with --strategy, else paper."
    },
    "preview": {
      "type": "boolean",
      "description": "Run every gate and list the exits without sending them.",
      "default": false
    },
    "confirmation_code": {
      "type": "string",
      "description": "Only after the user explicitly approves the preview: the code a previous call of this tool returned."
    }
  },
  "additionalProperties": false
}

trade_notional

Buy (or sell) a dollar amount of a stock: a fractional, DAY, market order sized in dollars. Live needs a code.

CLI equivalent: idiotproof trade notional <symbol> <amount> [--side <buy|sell>] [--stop <decimal>] [--target <decimal>] [--mode <sandbox|paper|live>] [--note <string>] Examples: idiotproof trade notional AAPL 500 --stop 220 --mode paper idiotproof trade notional AAPL 250 --side sell --mode live

MOVES MONEY. Sandbox and Paper run immediately. A Live action returns status confirmation-required with a preview and a code instead of executing: show the user the preview verbatim, ask them, and only if they say yes call this tool again with the identical arguments plus confirmation_code. Never invent or reuse a code. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Buy (or sell) a dollar amount of a stock: a fractional, DAY, market order sized in dollars. Live needs a code.",
  "properties": {
    "symbol": {
      "type": "string",
      "description": "Ticker, e.g. AAPL.",
      "default": ""
    },
    "amount": {
      "type": "number",
      "description": "Dollars to buy (or sell) \u2014 Alpaca works out the fractional shares.",
      "default": 0
    },
    "side": {
      "type": "string",
      "enum": [
        "buy",
        "sell"
      ],
      "description": "buy (default, opens/adds to a long) or sell (trims a long by dollar value).",
      "default": "buy"
    },
    "stop": {
      "type": "number",
      "description": "Protective stop price for a buy; the Risk Guardian refuses entries without one."
    },
    "target": {
      "type": "number",
      "description": "Take-profit price (for the reward:risk check)."
    },
    "mode": {
      "type": "string",
      "enum": [
        "sandbox",
        "paper",
        "live"
      ],
      "description": "Where it routes: sandbox (simulator, the default), paper, or live (needs confirmation).",
      "default": "sandbox"
    },
    "note": {
      "type": "string",
      "description": "Why \u2014 kept in the audit trail."
    },
    "confirmation_code": {
      "type": "string",
      "description": "Only after the user explicitly approves the preview: the code a previous call of this tool returned."
    }
  },
  "additionalProperties": false,
  "required": [
    "symbol",
    "amount"
  ]
}

trade_pending

List Live confirmations still waiting for a yes.

CLI equivalent: idiotproof trade pending Examples: idiotproof trade pending

Read-only. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "List Live confirmations still waiting for a yes.",
  "properties": {},
  "additionalProperties": false
}

trade_preview

Run every gate on an order without placing it (no code issued).

CLI equivalent: idiotproof trade preview <action> <symbol> [<qty>] [--dollars <decimal>] [--limit <decimal>] [--stop <decimal>] [--target <decimal>] [--mode <sandbox|paper|live>] [--ext] Examples: idiotproof trade preview buy NVDA 10 --limit 131 --stop 127 --mode live

Read-only. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Run every gate on an order without placing it (no code issued).",
  "properties": {
    "action": {
      "type": "string",
      "enum": [
        "buy",
        "sell",
        "short",
        "cover"
      ],
      "description": "buy, sell, short or cover.",
      "default": "buy"
    },
    "symbol": {
      "type": "string",
      "description": "Ticker.",
      "default": ""
    },
    "qty": {
      "type": "integer",
      "description": "Shares (or use --dollars)."
    },
    "dollars": {
      "type": "number",
      "description": "Size by dollar amount."
    },
    "limit": {
      "type": "number",
      "description": "Limit price."
    },
    "stop": {
      "type": "number",
      "description": "Protective stop price."
    },
    "target": {
      "type": "number",
      "description": "Take-profit price."
    },
    "mode": {
      "type": "string",
      "enum": [
        "sandbox",
        "paper",
        "live"
      ],
      "description": "sandbox (default), paper or live.",
      "default": "sandbox"
    },
    "ext": {
      "type": "boolean",
      "description": "Extended hours.",
      "default": false
    }
  },
  "additionalProperties": false,
  "required": [
    "action",
    "symbol"
  ]
}

trade_sell

Sell shares you hold (close or trim a long). Exits always clear the gates.

CLI equivalent: idiotproof trade sell <symbol> [<qty>] [--dollars <decimal>] [--limit <decimal>] [--stop <decimal>] [--target <decimal>] [--mode <sandbox|paper|live>] [--ext] [--tif <string>] [--note <string>] Examples: idiotproof trade sell NVDA 10 --mode paper

MOVES MONEY. Sandbox and Paper run immediately. A Live action returns status confirmation-required with a preview and a code instead of executing: show the user the preview verbatim, ask them, and only if they say yes call this tool again with the identical arguments plus confirmation_code. Never invent or reuse a code. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Sell shares you hold (close or trim a long). Exits always clear the gates.",
  "properties": {
    "symbol": {
      "type": "string",
      "description": "Ticker, e.g. NVDA.",
      "default": ""
    },
    "qty": {
      "type": "integer",
      "description": "Shares. Leave out and pass --dollars to size by amount."
    },
    "dollars": {
      "type": "number",
      "description": "Size by dollar amount instead of shares (fractional, regular hours only)."
    },
    "limit": {
      "type": "number",
      "description": "Limit price. Without it the order is a market order."
    },
    "stop": {
      "type": "number",
      "description": "Protective stop price for an entry; the Risk Guardian refuses entries without one."
    },
    "target": {
      "type": "number",
      "description": "Take-profit price (for the reward:risk check)."
    },
    "mode": {
      "type": "string",
      "enum": [
        "sandbox",
        "paper",
        "live"
      ],
      "description": "Where it routes: sandbox (simulator, the default), paper, or live (needs confirmation).",
      "default": "sandbox"
    },
    "ext": {
      "type": "boolean",
      "description": "Extended hours (premarket/after-hours); requires --limit, DAY.",
      "default": false
    },
    "tif": {
      "type": "string",
      "description": "Time in force: day (default) or gtc.",
      "default": "day"
    },
    "note": {
      "type": "string",
      "description": "Why \u2014 kept in the audit trail."
    },
    "confirmation_code": {
      "type": "string",
      "description": "Only after the user explicitly approves the preview: the code a previous call of this tool returned."
    }
  },
  "additionalProperties": false,
  "required": [
    "symbol"
  ]
}

trade_short

Sell short (open a short). Needs a stop above entry; margin + shortable name at the broker.

CLI equivalent: idiotproof trade short <symbol> [<qty>] [--dollars <decimal>] [--limit <decimal>] [--stop <decimal>] [--target <decimal>] [--mode <sandbox|paper|live>] [--ext] [--tif <string>] [--note <string>] Examples: idiotproof trade short TSLA 5 --limit 240 --stop 246

MOVES MONEY. Sandbox and Paper run immediately. A Live action returns status confirmation-required with a preview and a code instead of executing: show the user the preview verbatim, ask them, and only if they say yes call this tool again with the identical arguments plus confirmation_code. Never invent or reuse a code. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Sell short (open a short). Needs a stop above entry; margin \u002B shortable name at the broker.",
  "properties": {
    "symbol": {
      "type": "string",
      "description": "Ticker, e.g. NVDA.",
      "default": ""
    },
    "qty": {
      "type": "integer",
      "description": "Shares. Leave out and pass --dollars to size by amount."
    },
    "dollars": {
      "type": "number",
      "description": "Size by dollar amount instead of shares (fractional, regular hours only)."
    },
    "limit": {
      "type": "number",
      "description": "Limit price. Without it the order is a market order."
    },
    "stop": {
      "type": "number",
      "description": "Protective stop price for an entry; the Risk Guardian refuses entries without one."
    },
    "target": {
      "type": "number",
      "description": "Take-profit price (for the reward:risk check)."
    },
    "mode": {
      "type": "string",
      "enum": [
        "sandbox",
        "paper",
        "live"
      ],
      "description": "Where it routes: sandbox (simulator, the default), paper, or live (needs confirmation).",
      "default": "sandbox"
    },
    "ext": {
      "type": "boolean",
      "description": "Extended hours (premarket/after-hours); requires --limit, DAY.",
      "default": false
    },
    "tif": {
      "type": "string",
      "description": "Time in force: day (default) or gtc.",
      "default": "day"
    },
    "note": {
      "type": "string",
      "description": "Why \u2014 kept in the audit trail."
    },
    "confirmation_code": {
      "type": "string",
      "description": "Only after the user explicitly approves the preview: the code a previous call of this tool returned."
    }
  },
  "additionalProperties": false,
  "required": [
    "symbol"
  ]
}

users_create

Create an IdiotProof account (blocklist and password rules of web sign-up; Argon2id via MindAttic.Authentication).

CLI equivalent: idiotproof users create <email> --password <string> [--role <string>] [--must-change] Examples: idiotproof users create trader@example.com --password <password> idiotproof users create admin@example.com --password <password> --role Admin --must-change

Changes saved state. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Create an IdiotProof account (blocklist and password rules of web sign-up; Argon2id via MindAttic.Authentication).",
  "properties": {
    "email": {
      "type": "string",
      "description": "The new account\u0027s email (also its user name).",
      "default": ""
    },
    "password": {
      "type": "string",
      "description": "Initial password: 8 to 128 characters with at least one digit.",
      "default": ""
    },
    "role": {
      "type": "string",
      "description": "User (default) or Admin.",
      "default": "User"
    },
    "must_change": {
      "type": "boolean",
      "description": "Make them choose a new password at first sign-in.",
      "default": false
    }
  },
  "additionalProperties": false,
  "required": [
    "email",
    "password"
  ]
}

users_list

List the IdiotProof accounts (test fixtures hidden unless --all); * marks who you act as.

CLI equivalent: idiotproof users list [--all] Examples: idiotproof users list idiotproof users list --all

Read-only. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "List the IdiotProof accounts (test fixtures hidden unless --all); * marks who you act as.",
  "properties": {
    "all": {
      "type": "boolean",
      "description": "Include test-fixture accounts (@idiotproof.local and bare user names), hidden by default.",
      "default": false
    }
  },
  "additionalProperties": false
}

watchlist_add

Add symbols to your IdiotProof watchlist (creates a 'Main' workspace when you have none).

CLI equivalent: idiotproof watchlist add <symbols>... [--workspace <string>] Examples: idiotproof watchlist add NVDA AAPL idiotproof watchlist add TSLA --workspace Main

Changes saved state. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Add symbols to your IdiotProof watchlist (creates a \u0027Main\u0027 workspace when you have none).",
  "properties": {
    "symbols": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "One or more ticker symbols (space or comma separated)."
    },
    "workspace": {
      "type": "string",
      "description": "Which workspace (name or id); needed only when you have more than one."
    }
  },
  "additionalProperties": false,
  "required": [
    "symbols"
  ]
}

watchlist_list

Your IdiotProof watchlist: the symbols on each of your workspaces (not Alpaca's watchlists).

CLI equivalent: idiotproof watchlist list [--workspace <string>] Examples: idiotproof watchlist list idiotproof watchlist list --workspace Main

Read-only. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Your IdiotProof watchlist: the symbols on each of your workspaces (not Alpaca\u0027s watchlists).",
  "properties": {
    "workspace": {
      "type": "string",
      "description": "Only this workspace (name or id)."
    }
  },
  "additionalProperties": false
}

watchlist_remove

Remove symbols from your IdiotProof watchlist.

CLI equivalent: idiotproof watchlist remove <symbols>... [--workspace <string>] Examples: idiotproof watchlist remove AAPL

Changes saved state. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Remove symbols from your IdiotProof watchlist.",
  "properties": {
    "symbols": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "One or more ticker symbols (space or comma separated)."
    },
    "workspace": {
      "type": "string",
      "description": "Which workspace (name or id); needed only when you have more than one."
    }
  },
  "additionalProperties": false,
  "required": [
    "symbols"
  ]
}

watchlists_add

Add symbols to an Alpaca watchlist (by id or name).

CLI equivalent: idiotproof watchlists add <watchlist> <symbols>... [--mode <paper|live>] Examples: idiotproof watchlists add tech AMD AVGO

Changes saved state. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Add symbols to an Alpaca watchlist (by id or name).",
  "properties": {
    "watchlist": {
      "type": "string",
      "description": "Watchlist id or name.",
      "default": ""
    },
    "symbols": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "One or more symbols (space or comma separated)."
    },
    "mode": {
      "type": "string",
      "enum": [
        "paper",
        "live"
      ],
      "description": "Alpaca account: paper (default) or live.",
      "default": "paper"
    }
  },
  "additionalProperties": false,
  "required": [
    "watchlist",
    "symbols"
  ]
}

watchlists_create

Create an Alpaca watchlist, optionally with symbols.

CLI equivalent: idiotproof watchlists create <name> [<symbols>...] [--mode <paper|live>] Examples: idiotproof watchlists create tech AAPL MSFT NVDA

Changes saved state. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Create an Alpaca watchlist, optionally with symbols.",
  "properties": {
    "name": {
      "type": "string",
      "description": "Name for the new watchlist.",
      "default": ""
    },
    "symbols": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Symbols to start with (space or comma separated)."
    },
    "mode": {
      "type": "string",
      "enum": [
        "paper",
        "live"
      ],
      "description": "Alpaca account: paper (default) or live.",
      "default": "paper"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

watchlists_delete

Delete an Alpaca watchlist (by id or name).

CLI equivalent: idiotproof watchlists delete <watchlist> [--mode <paper|live>] Examples: idiotproof watchlists delete tech

DESTRUCTIVE. If it returns confirmation-required, show the preview and call again with confirmation_code only after the user agrees. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Delete an Alpaca watchlist (by id or name).",
  "properties": {
    "watchlist": {
      "type": "string",
      "description": "Watchlist id or name.",
      "default": ""
    },
    "mode": {
      "type": "string",
      "enum": [
        "paper",
        "live"
      ],
      "description": "Alpaca account: paper (default) or live.",
      "default": "paper"
    },
    "confirmation_code": {
      "type": "string",
      "description": "Only after the user explicitly approves the preview: the code a previous call of this tool returned."
    }
  },
  "additionalProperties": false,
  "required": [
    "watchlist"
  ]
}

watchlists_list

Your Alpaca server-side watchlists (not IdiotProof's local watchlist): name, id, last update.

CLI equivalent: idiotproof watchlists list [--mode <paper|live>] Examples: idiotproof watchlists list idiotproof watchlists list --mode live

Read-only. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Your Alpaca server-side watchlists (not IdiotProof\u0027s local watchlist): name, id, last update.",
  "properties": {
    "mode": {
      "type": "string",
      "enum": [
        "paper",
        "live"
      ],
      "description": "Alpaca account: paper (default) or live.",
      "default": "paper"
    }
  },
  "additionalProperties": false
}

watchlists_remove

Remove symbols from an Alpaca watchlist (by id or name).

CLI equivalent: idiotproof watchlists remove <watchlist> <symbols>... [--mode <paper|live>] Examples: idiotproof watchlists remove tech AMD

Changes saved state. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Remove symbols from an Alpaca watchlist (by id or name).",
  "properties": {
    "watchlist": {
      "type": "string",
      "description": "Watchlist id or name.",
      "default": ""
    },
    "symbols": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "One or more symbols (space or comma separated)."
    },
    "mode": {
      "type": "string",
      "enum": [
        "paper",
        "live"
      ],
      "description": "Alpaca account: paper (default) or live.",
      "default": "paper"
    }
  },
  "additionalProperties": false,
  "required": [
    "watchlist",
    "symbols"
  ]
}

watchlists_rename

Rename an Alpaca watchlist, keeping its symbols.

CLI equivalent: idiotproof watchlists rename <watchlist> <new-name> [--mode <paper|live>] Examples: idiotproof watchlists rename tech megacaps

Changes saved state. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "Rename an Alpaca watchlist, keeping its symbols.",
  "properties": {
    "watchlist": {
      "type": "string",
      "description": "Watchlist id or current name.",
      "default": ""
    },
    "new_name": {
      "type": "string",
      "description": "The new name.",
      "default": ""
    },
    "mode": {
      "type": "string",
      "enum": [
        "paper",
        "live"
      ],
      "description": "Alpaca account: paper (default) or live.",
      "default": "paper"
    }
  },
  "additionalProperties": false,
  "required": [
    "watchlist",
    "new_name"
  ]
}

watchlists_show

One Alpaca watchlist (by id or name) and its symbols.

CLI equivalent: idiotproof watchlists show <watchlist> [--mode <paper|live>] Examples: idiotproof watchlists show tech idiotproof watchlists show 3174d6df-7726-44b4-a5bd-7fda5ae6e009 --mode live

Read-only. Times are US Eastern.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "description": "One Alpaca watchlist (by id or name) and its symbols.",
  "properties": {
    "watchlist": {
      "type": "string",
      "description": "Watchlist id or name.",
      "default": ""
    },
    "mode": {
      "type": "string",
      "enum": [
        "paper",
        "live"
      ],
      "description": "Alpaca account: paper (default) or live.",
      "default": "paper"
    }
  },
  "additionalProperties": false,
  "required": [
    "watchlist"
  ]
}
Part 3 of 3: 1 · 2 · 3