> Every Taji docs page as Markdown: https://docs.taji.is/llms.txt

# Robinhood Agentic: how it works

Robinhood's Agentic Trading gives an AI agent its own funded brokerage account and one hosted MCP endpoint, `https://agent.robinhood.com/mcp/trading`. Taji signs in to that endpoint as an OAuth public client and uses it for two things. It trades the account: equity, single-leg option and crypto orders, an equity OCO, and option exercise. It also reads Robinhood's market data; what Taji reads, down to each field, is [the coverage page](https://docs.taji.is/reference/coverage/robinhood-agentic.md). The plugin is one Rust crate, `taji-robinhood`, at `plugins/robinhood-agentic/`. It registers a data source, a venue arm and a link auth under the one id `robinhood-agentic`. It shares its response decoders with Robinhood web through the library crate `plugins/robinhood-reads`, which [Robinhood web's page](https://docs.taji.is/catalog/robinhood-web/architecture.md) describes.

## The vendor

**Hosts and environments.** Two hosts, both in `HOSTS` (`src/mcp/mod.rs`):

- `agent.robinhood.com` serves the MCP endpoint `/mcp/trading` and the client registration `/oauth/trading/register`.
- `api.robinhood.com` serves the token endpoint `/oauth2/token/`.

The consent screen is `https://robinhood.com/oauth`. There is one environment, live. Robinhood has no paper or sandbox account for agents, so every order Taji sends is real money.

**Account model.** An Agentic account is "a type of self-directed individual investing account". You open it beside a primary individual account that must be in good standing, and it counts toward Robinhood's limit of 10 self-directed accounts. The agent trades only with funds you deposit into that account. A connected agent can read all of your Robinhood accounts: account numbers, positions, balances and order history. It can place trades only in the Agentic one ([onboarding an external agent](https://robinhood.com/us/en/support/articles/onboarding-an-external-agent/), fetched 2026-12-02). In the account listing, the row an agent may trade carries `agentic_allowed: true`.

Robinhood lets agents place long equity, option and crypto orders: market (by shares or by dollars), limit, stop limit and stop market. Agents cannot place multi-leg option orders ([trading with your agent](https://robinhood.com/us/en/support/articles/trading-with-your-agent/), fetched 2026-12-02). Crypto needs a matching Robinhood Crypto account and is unavailable in some states, New York among them (same page).

**Trade approvals.** With approvals on, the agent proposes and you place each order in the app. They default off for an external (MCP) agent and on for Robinhood's built-in agent. Robinhood adds that "certain trades may still require your approval even when trade approvals are turned off" (same page). The account reports the setting as `data.setting.human_must_approve_trades`.

**Auth model.** The endpoint follows the MCP authorization profile: OAuth 2.1, Dynamic Client Registration (RFC 7591), PKCE and a bearer token on every request. For public clients the authorization server must rotate refresh tokens ([MCP authorization, 2025-06-18](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization), fetched 2026-12-02). Robinhood's support pages say only "follow the authentication steps": they name no scope, token lifetime or revocation path. What Taji relies on is measured and recorded in the README's [The credential](https://docs.taji.is/catalog/robinhood-agentic.md#the-credential) and [MCP has no read-only scope](https://docs.taji.is/catalog/robinhood-agentic.md#mcp-has-no-read-only-scope):

- The server issues one scope, `internal`, and it can place orders.
- Each refresh token works once. Every grant returns a new one, and a second grant with the old token is answered 401.
- The token is valid at that MCP client alone. On every other Robinhood surface it gets 401.

`TOKEN_REFRESH_MARGIN` in `src/mcp/mod.rs` refreshes one hour before expiry. A grant's `expires_in` is read; one with no positive value is taken as 5.0 days, an assumed floor under the lifetimes measured (README, [The credential](https://docs.taji.is/catalog/robinhood-agentic.md#the-credential)).

**The API family.** One API: MCP over Streamable HTTP, protocol `2025-06-18` ([MCP transports](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports), fetched 2026-12-02). Each message is a JSON-RPC 2.0 POST. A request is answered as `text/event-stream`, and a notification as 202. A session id is optional, and a server that forgets one answers 404. A `tools/call` answer carries `structuredContent.data`. The server lists 95 tools in its `tools/list`, each with an `inputSchema` that sets `additionalProperties: false`. `tests/fixtures/tools-list.json` holds that list as read on 2026-11-19. The tool families are accounts and portfolio, equity, options, crypto, market data, watchlists, alerts, scans, banking, and eight `*_legend_*` tools for Robinhood's own web charts. The [trading with your agent](https://robinhood.com/us/en/support/articles/trading-with-your-agent/) page lists them. Robinhood publishes no separate API reference, so the tool list is the contract.

**Stated limits.** Robinhood states three caps, all in tool descriptions: real-time quotes for up to 20 equity symbols, a "Level 2 order book … for up to 4 stocks", and 10 symbols per `get_equity_historicals` call. It publishes no rate limit and no concurrency limit. The ones Taji uses are measured: see [MCP rate limit](https://docs.taji.is/catalog/robinhood-agentic.md#mcp-rate-limit).

**What Taji does not use, and why:**

- **Multi-leg option orders.** `place_option_order` refuses them, though `review_option_order` accepts 2- and 4-leg previews ([Trades](https://docs.taji.is/catalog/robinhood-agentic.md#trades)).
- **Watchlist, alert and scan writes** (`AGENT_TOOLS`). Taji spells and dispatches them, but no engine node calls them: not yet built.
- **`decline_trade_approval`.** Taji refuses to place an order while approvals are on rather than driving the approval queue (see [Why it is built this way](#why-it-is-built-this-way)).
- **Disconnecting.** Robinhood's app is the only place a grant is revoked; a disconnect from Taji is not yet built.

### Offered, not read

What Taji reads, down to each field it fills, is [`docs/reference/coverage/robinhood-agentic.md`](https://docs.taji.is/reference/coverage/robinhood-agentic.md). What Robinhood serves past that. Every row is a tool on the one Agentic endpoint, and the pages name no data tier (no Gold or Level 2 requirement), so a plan is no column. `Page` is [trading with your agent](https://robinhood.com/us/en/support/articles/trading-with-your-agent/); the fields of a tool's answer are the keys its decoder in `plugins/robinhood-reads/src/market.rs` reads off the tool's `outputSchema`.

| Offered | Endpoint | Source, fetched |
|---|---|---|
| A quote's prior close (`previous_close`, `adjusted_previous_close`, `previous_close_date`) and venue state (`has_traded`, `state`; an index value's `state`): `point_row` drops them, and `quotes` holds no prior-close column | `get_equity_quotes`, `get_index_quotes` | Page ("real-time equity quotes and prior close for up to 20 symbols"), 2026-12-04; `equity_quote_row`, `decode_index_quotes` |
| A crypto quote's `mark_price`, `open_price` and previous close | `get_crypto_quotes` | Page ("real-time bid/ask/mark prices plus previous close"), 2026-12-04; `crypto_quote_row` |
| An option quote's `mark_price`, `adjusted_mark_price`, `break_even_price` and previous close; its `bid_size` and `ask_size` fill `quotes` but `chains` holds no size column | `get_option_quotes` | Page ("real-time quotes for option contracts"), 2026-12-04; `decode_option_quotes` |
| A listed chain's `settle_on_open` (`SPX` true, `SPXW` false, README [Order handling](https://docs.taji.is/catalog/robinhood-agentic.md#order-handling), 2026-11-19) and `can_open_position`: `contract_row` fills no `settlement` | `get_option_chains` | `decode_option_chains` |
| A fundamentals row's day figures (`open`, `high`, `low`, `volume`, `overnight_volume`; `forming_day` reads the first four), `average_volume` (names no horizon, measured equal to the 2-week figure), `thirty_day_sec_yield`, `distribution_frequency`, `record_date`, `payable_date` and the `financial_status_*` pair: `details` holds no column for them | `get_equity_fundamentals` | Page ("valuation ratios, market cap, 52-week range, dividend info, and today's OHLCV"), 2026-12-04; `decode_fundamentals` |
| An analyst row's `num_buy_ratings`, `num_hold_ratings`, `num_sell_ratings`, `high_price_target` and `low_price_target`: `fundamentals` states the mean target alone (`target_price`) | `get_equity_analyst_ratings` | Page ("analyst price targets and Buy/Hold/Sell ratings"), 2026-12-04; `decode_ratings` |
| A scan's result columns, which are the user's own words: `screener` rows state rank and symbol alone. `get_scanner_datapoints` and `get_scanner_filter_specs` list the columns and filters a scan can take | `run_scan`, `get_scanner_datapoints`, `get_scanner_filter_specs` | Page ("get data points returned by a scanner"), 2026-12-04; `screener_rows` |
| Technical indicators ("RSI, MACD, Bollinger Bands, moving averages, and more"): spelled in `DataCall`, read by nothing, Taji computes its own | `get_equity_technical_indicators` | Page, 2026-12-04 |
| SEC filings and the facts extracted from them; disclosed US politician trades: spelled, read by nothing | `get_sec_filing_index`, `get_sec_filing`, `get_sec_filing_facts`, `get_sec_filing_facts_catalog`, `get_politician_trades` | Page, 2026-12-04 |
| The account's tax lots, realized P&L and trade-by-trade P&L history, margin and options upgrade info, bank and credit card accounts and activity, the approval queue, watchlists and alerts and their log: spelled, read by nothing. The page also lists `get_crypto_tax_lots`, which the `tools/list` of 2026-11-19 does not | `get_equity_tax_lots`, `get_realized_pnl`, `get_pnl_trade_history`, `get_limited_margin_upgrade_info`, `get_option_level_upgrade_info`, `get_bank_accounts`, `get_banking_transactions`, `get_credit_card_account`, `get_credit_transactions`, `get_trade_approvals`, `get_watchlists`, `get_watchlist_items`, `get_popular_watchlists`, `get_option_watchlist`, `get_alerts`, `get_alert_log` | Page, 2026-12-04 |
| News and earnings call transcripts, which the page shows with a single check, so for built-in agents alone; `get_equity_news` answers `unknown tool`, and the `tools/list` of 2026-11-19 has no transcript tool | `get_equity_news`, `get_earnings_transcript` | Page, 2026-12-04; README [MCP has no read-only scope](https://docs.taji.is/catalog/robinhood-agentic.md#mcp-has-no-read-only-scope) |
| Robinhood's own web charts, eight `*_legend_*` tools, listed for built-in agents alone; `tests/official_schema.rs` names them as not Taji's | `get_legend_charts` and the other seven | Page, 2026-12-04 |

## Code map

Paths below are under `plugins/robinhood-agentic/`.

| File | Owns | Read first |
|---|---|---|
| `src/lib.rs` | `ID`, `provider()`, `venue()`, and `Plugin`, which registers the source, the arm and the auth | `Plugin::build` |
| `src/link.rs` | The link `Auth`: the PKCE sign-in declaration, client registration, and the one tradable account a grant names | `Auth::check`, `rows` |
| `src/venue.rs` | `FACTS` (`VenueFacts`), the fee table, and the `VenueArm` that binds the broker and the reads to one session | `Arm::bind` |
| `src/offer.rs` | `OFFER` and `VENUE_OFFER`, the `data/coverage` cells | `offered`, `orders` |
| `src/source.rs` | `RobinhoodAgentic` as a `Source`: its `FACTS`, the bars `CAP`, the seat and poll, and the `get/<product>` reads | `READS`, `FILLS`, `Source::seat`, `raw` |
| `src/source/chain.rs` | `ChainCalls` for the shared chain read | `AgenticChain` |
| `src/mcp/mod.rs` | The containment rule, `HOSTS`, the endpoint constants and the three tool lists `ALLOWED_TOOLS`, `ORDER_TOOLS` and `AGENT_TOOLS` | the module doc |
| `src/mcp/authorize.rs` | RFC 7591 registration of a public client; `AUTHORIZE_URL` and `SCOPE` | `register_at` |
| `src/mcp/session.rs` | `McpSession`: the one session per login, the refresh grant, the handshake, the two rate budgets, the three private dispatches and order send-once | `send`, `exchange`, `order_raw` |
| `src/mcp/calls/mod.rs` | The sealed `DataCall`, `OrderCall` and `AgentCall` enums, their argument building, and the typed decoders | `DataCall::arguments` |
| `src/mcp/calls/{account,agent,crypto,equity,options,orders}.rs` | One request type per tool, each with constructor checks taken from the tool's description | `orders.rs` `EquityOrder` |
| `src/mcp/broker.rs` | `RhAgenticBroker` as `ExecutionOps`: the approvals check, the long-only refusal, the equity place and its read-back, cancels, status, positions, and the capability and protection matrices | `place_impl` |
| `src/mcp/broker/{option,crypto,advanced}.rs` | Option orders (a contract resolved to its instrument UUID) and exercise; crypto on `rhs_account_number`; the equity OCO | `option::order` |
| `src/mcp/venue_reads.rs` | `RhAgenticVenueReads` (the money, off `get_portfolio`), and the quote, book and minute fetches the poller calls | `VenueReads for RhAgenticVenueReads` |
| `src/mcp/history.rs` | `RhAgenticBars` as `HistoricalData`: equity, index and option bars and their decoding | `get_bars_many`, `parse_bars` |
| `src/mcp/poll.rs` | `RhPoller` as `LiveStream`: one 500 ms tick polls bars, quotes and books for every subscription | `poll_step`, `RhPoller::new` |
| `src/mcp/market.rs` | The market reads behind `get/<product>`, decoded into rows stamped `ts_utc` | `point_quote`, `financials_raw` |
| `src/mcp/earnings.rs` | `get_earnings_results`, one symbol per call | `results` |
| `src/mcp/egress_tests.rs` | The byte goldens of what the session sends | `read` |
| `tests/official_schema.rs` | The schema gate against `tests/fixtures/tools-list.json` | `the_three_lists_partition_the_servers_own_list` |
| `tests/mcp_wire_shape.rs` | A refusal for any price basis other than split plus spin-off | the one test |

## How it plugs into Taji

**Composition.** `engine/crates/taji-open/src/lib.rs` adds `taji_robinhood::Plugin`. `Plugin::build` registers three things:

- `source::RobinhoodAgentic` as a `Source`;
- `venue::Arm` as a `VenueArm`;
- `link::Auth` as the link's `Auth`.

The manifest `taji-plugin.toml` declares one `[[sources]]` and one `[[link]]` form, `robinhood-agentic`, `env = "live"`, `kind = "start"`. Its step and its refusal words (`no_agentic`, `many_agentic`) are the link sheet's (see the manifest). The README's [Linking](https://docs.taji.is/catalog/robinhood-agentic.md#linking) table names what each step opens.

**Traits implemented.**

| Trait | Type | File |
|---|---|---|
| `Source` | `RobinhoodAgentic` | `src/source.rs` |
| `HistoricalData` | `RhAgenticBars` | `src/mcp/history.rs` |
| `LiveStream` | `RhPoller` | `src/mcp/poll.rs` |
| `VenueArm` | `Arm` | `src/venue.rs` |
| `ExecutionOps` | `RhAgenticBroker` | `src/mcp/broker.rs` |
| `VenueReads` | `RhAgenticVenueReads` | `src/mcp/venue_reads.rs` |
| `Auth` | `link::Auth` | `src/link.rs` |
| `ChainCalls` | `AgenticChain` | `src/source/chain.rs` |

The traits themselves live in `substrate/taji-brokerage/src/traits/` and `engine/crates/taji-plugin/src/vendor/`. The crate implements no `ReconcileOps`: reconcile reads `ExecutionOps::positions` and `orders_since`.

**Statics.**

- `source::FACTS` (`plugin::Facts`, seat `Venue`) lists every `(class, product, span)` the source answers in `READS` and the optional columns it fills of each in `FILLS`, held by the tests' decoded rows. It also sets per-call capacities of 10 bars symbols, 20 quote symbols and 4 book symbols, `overnight_live: true`, a polled book, and `live_lag_s: Some(1)`.
- `CAP` is the bars row:
  - classes equity, index and option;
  - basis `SplitSpinoff` alone;
  - option bars `volumeless`;
  - `rate_per_min: 960`;
  - native 5m and 30m bars, plus equity 1h on extended and 24h.
- `venue::FACTS` (`VenueFacts`):
  - one record, `(Env::Live, "robinhood-agentic")`;
  - `public_client: true`;
  - an OAuth `LinkFacts`;
  - a fee function citing Robinhood's fee schedule;
  - the capability and protection matrices from `src/mcp/broker.rs`.
- `OFFER`, `VENUE_OFFER` and `FILLS` fill the [coverage page](https://docs.taji.is/reference/coverage/robinhood-agentic.md), cell by cell and field by field.

**The credential.** The link runs the kernel's own sign-in engine. `Auth::sign_in` declares PKCE, `AUTHORIZE_URL`, `TOKEN_URL`, scope `internal` and resource `MCP_URL`, with no client secret. `Auth::client` registers a fresh public client for the kernel's loopback redirect. Registration adds a client: it does not invalidate the one your own agent platform already holds. `Auth::check` lists accounts and accepts exactly one with `agentic_allowed: true`. It refuses `no_agentic` for none, `many_agentic` for more than one, `invalid_key` on a 401 and `exchange` on any other failure. The record holds `client_id` and `refresh_token`, and a grant seals `access_token` beside them. The kernel's authorize trip and code exchange and the plugin's refresh grant each carry `resource=https://agent.robinhood.com/mcp/trading`, which MCP authorization requires on the authorization request and every token request (RFC 8707).

**Surfaces and the calls behind them.**

| Taji surface | Vendor tool | File |
|---|---|---|
| `POST /verb/link/venue/start` | `/oauth/trading/register`, `robinhood.com/oauth`, `/oauth2/token/`, `get_accounts` | `src/link.rs`, `src/mcp/authorize.rs` |
| `GET /read/trading/<acct>/account` | `get_portfolio` | `src/mcp/venue_reads.rs` |
| positions (reconcile and the account's reads) | `get_equity_positions`, `get_option_positions`, `get_crypto_positions` | `src/mcp/broker.rs` |
| `GET /read/trading/<acct>/orders` | `get_equity_orders`, `get_option_orders`, `get_crypto_orders`, `get_advanced_orders` | `src/mcp/broker.rs`, `src/mcp/broker/advanced.rs` |
| `POST /verb/trading/orders/<class>/place` | `get_trade_approval_setting`, then `place_equity_order`, `place_option_order`, `place_crypto_order` or (an OCO) `review_advanced_order` and `place_advanced_order` | `src/mcp/broker.rs` and `src/mcp/broker/` |
| `POST /verb/trading/orders/<class>/preview` | `review_equity_order`, `review_option_order`, `preview_crypto_order` | `src/mcp/broker.rs` |
| `POST /verb/trading/<acct>/orders/<id>/cancel` | `cancel_equity_order`, `cancel_option_order`, `cancel_crypto_order`, `cancel_advanced_order` | `src/mcp/broker.rs` |
| `POST /verb/trading/<acct>/positions/<contract>/exercise` | `exercise_option` | `src/mcp/broker/option.rs` |
| `GET /get/bars` (history) | `get_equity_historicals` (10 symbols a call), `get_index_historicals`, `get_option_historicals` | `src/mcp/history.rs` |
| live bars and quotes (the hub's ticks) | `get_equity_historicals` `minute`, `get_equity_quotes`, `get_crypto_quotes`, `get_index_quotes` (an index's 1m bar is Taji's fold of these), `get_option_historicals`, `get_option_quotes`, `get_equity_price_book` | `src/mcp/poll.rs`, `src/mcp/venue_reads.rs` |
| `GET /get/quotes`, `GET /get/depth` | the same quote tools; `get_equity_price_book` | `src/source.rs`, `src/mcp/market.rs` |
| `GET /get/chains` | `get_option_chains`, `get_option_instruments`, `get_option_quotes` | `src/source/chain.rs` |
| `GET /get/fundamentals` (`kind` `analyst`, `float`, `income`) | `get_equity_analyst_ratings`, `get_equity_fundamentals`, `get_financials` | `src/source.rs`, `src/mcp/market.rs` |
| `GET /get/earnings` | `get_earnings_calendar`, `get_earnings_results` | `src/source.rs`, `src/mcp/earnings.rs` |
| `GET /get/screener` (`scan`) | `get_scans`, `run_scan` | `src/mcp/market.rs` |
| `GET /get/search`, `GET /get/instrument`, `GET /get/details` | `search`, `get_equity_tradability`, `get_currency_pairs` | `src/mcp/market.rs` |

**A read, end to end.** Take `GET /get/bars?symbols=equity:AAPL&provider=robinhood-agentic`. The hub serves from its store first. For a gap, it asks `Source::history`, which returns an `RhAgenticBars` on the login's one `McpSession`.

1. `get_bars` splits the window into chunks of at most 5,000 bars a symbol. For each chunk it builds a `HistoricalsRequest` and calls `McpSession::historicals_frame`, which wraps the request as `DataCall::EquityHistoricals`.
2. The private `dispatch` asserts the tool name is in `ALLOWED_TOOLS`.
3. `send` admits the call on the `rh-agentic-data` budget.
4. `exchange` makes sure a fresh access token is held, granting one under the session's `token` mutex if not, and opens the MCP session if needed. It then POSTs `tools/call`. A 400 or 404 re-handshakes once.
5. The frame is kept as `robinhood.bars.v1`, `parse_bars` decodes it, and the hub cuts and stores the bars.

**An order, end to end.** `POST /verb/trading/orders/equity/place` passes Taji's risk gate, then reaches `ExecutionOps::place_order` on the `RhAgenticBroker` bound to the account.

1. `place_impl` reads `get_trade_approval_setting` and refuses unsent if approvals are on.
2. `admit` validates the intent and checks the account.
3. For a sell, `refuse_a_short` reads `get_equity_positions` and refuses a quantity above what you hold.
4. `equity_order` builds the `EquityOrder` with its `market_hours` word. Its `ref_id` is the intent id.
5. `McpSession::order` sends it through `dispatch_order`, which asserts the tool is in `ORDER_TOOLS`, and decodes the ack `data.order.{id,state}`.

If the send died in transport, was throttled, or came back with no readable ack, the broker never re-POSTs. `readback_equity` waits out any throttle hold, reads `get_equity_orders`, and adopts the one row opened since the place that matches the symbol, side, quantity and limit. With no match or several, the place fails as `AckedUnconfirmed`, which calls for manual reconciliation.

Today `Arm::bind` refuses every bind while `mcp::WALKED` is `false`: "robinhood-agentic is refused at bind until its live walk passes". The walk it waits for is a strategy's first live order: `strategy_promote` onto `robinhood-agentic`, 1 share at most $500, filled and closed the same session, during regular hours with your yes.

## Why it is built this way

- **Tool names are types, not data.** Robinhood issues one order-capable scope, so nothing at the protocol layer stops a read path from placing an order. The crate makes the separation structural. No function takes a tool name as a value; names come from exhaustive matches on `DataCall`, `OrderCall` and `AgentCall`. Each of the three private dispatches `assert!`s its own `const` list. These are release-mode asserts, because `[profile.release]` strips `debug_assert!`. A unit test pins each list literally, and `tests/official_schema.rs` holds every variant to exactly one list (`src/mcp/mod.rs`).
- **One session per login.** A refresh token works once, so two refreshers would leave the loser permanently 401'd, and the only repair is a browser trip (measured 2026-08-21). `McpSession::of` keeps a weak table keyed by login. The source, the poller and the arm share that one session, and its `token` mutex is the only place a grant happens. A grant's answer is sealed into the `Login` before anything reads it, so the host's vault keeps the rotated token at once. A 401 on a grant gets no retry.
- **Endpoints are `const`.** `MCP_URL`, `TOKEN_URL` and `REGISTRATION_URL` have no override through an environment variable, argument or registry. A mis-set variable therefore cannot point an order-capable credential at another host. The test endpoint exists only under `cfg(test)` or the `test-endpoint` feature.
- **Send once, reconcile by what was asked.** Robinhood dedupes on `ref_id`, but its order rows state the venue's own `ref_id`, not the one sent (2026-11-20, [Order handling](https://docs.taji.is/catalog/robinhood-agentic.md#order-handling)). A lost ack is therefore resolved by matching symbol, side, quantity and limit. That follows TradeStation's read-back floor (`readback_equity`).
- **Long only, refused here.** The credential has no short surface. Refusing before send gives an answer you can read, where the venue would reject three seconds later (`src/mcp/broker.rs` module doc).
- **Approvals are checked on every place.** An order placed while approvals are on waits in the Robinhood app, where Taji cannot see it. The setting is read on every place and exercise, never cached, because you can switch it at any time.
- **Polling, not streaming.** The endpoint is request and answer only. One task polls for the whole process, not one per symbol, because the rate ceiling is account-wide (`src/mcp/poll.rs`). An index's 1m bar is folded from its polled quotes, not read from `get_index_historicals`. The venue prints an index minute only after it ends and revises it for 14 s or more ([As a hub history provider](https://docs.taji.is/catalog/robinhood-agentic.md#as-a-hub-history-provider)).
- **Bars are served as given.** Robinhood's 5m and 30m bars are not always the fold of its 1m bars. `CAP.native` declares them native, and Taji serves the vendor's own bars ("Served as given" in [As a hub history provider](https://docs.taji.is/catalog/robinhood-agentic.md#as-a-hub-history-provider)). The basis is fixed at split plus spin-off. `adjustment_type: "split"` is baked into every call, so any other basis refuses (`tests/mcp_wire_shape.rs`).
- **No key reaches a client** ([0005](https://github.com/TajiAI/Taji/blob/main/docs/decisions/0005-no-key-reaches-a-client.md)). The session's `Debug` prints nothing. Grant failures carry status lines, never bodies. Captures under `TAJI_RH_CAPTURE_DIR` are an operator's tap, and they log only the tool name when a write fails.
- **No vendor shape reaches a client** ([0004](https://github.com/TajiAI/Taji/blob/main/docs/decisions/0004-capabilities-through-the-hub.md)). Every read leaves as a hub product's rows (`taji_robinhood_reads::market`, `reference_rows`), and every order arrives as a neutral `OrderIntent`.

## Constraints and limits

- **Rate budgets.** Every call is admitted on one of two per-login budgets in `McpSession`:
  - `rh-agentic-data`, 16 a second: bars, quotes, books and every other market read. A call over this budget is refused unsent.
  - `rh-agentic-account`, 5 a second: accounts, portfolio, positions, orders and every write. A read over this budget waits once for the second to free; a write goes into debt.

  A `RATE_LIMITED` answer or an HTTP 429 holds both budgets for `RATE_LIMIT_HOLD` (5 s), and nothing is re-sent. The 16/s figure is the highest rate measured clean, and 5/s is assumed. Both numbers are in [MCP rate limit](https://docs.taji.is/catalog/robinhood-agentic.md#mcp-rate-limit).
- **The poller's spend.** At one tick every 500 ms, bars and quotes run 2 calls a second each and the book 1 a second: 5 a second in all. Options add at most 2 a second in the regular session. After a throttle the poller skips 10 ticks (5 s). After 30 consecutive failed polls the stream ends (`src/mcp/poll.rs`).
- **Idle connections.** The MCP host drops a connection left idle for 180 to 240 s. `WARM_EVERY` sends a `ping` every 120 s, and a warm never spends a grant.
- **Per-call caps.**
  - `get_equity_quotes`: 20 symbols. Above that, every row loses `closes`, and unknown symbols are dropped silently. `venue_reads::quotes` checks that each asked symbol came back.
  - `get_equity_price_book`: 4 symbols.
  - `get_equity_historicals`: 10 symbols (11 is refused) and 5,000 bars per symbol; Taji chunks a longer window.
  - `get_index_historicals`: the tool states 1,500 intervals. Taji chunks at the measured 1,440.
- **Account.** One Agentic account per grant, live only, cash, no margin. Equity and crypto are long only. Crypto routes on the numeric `rhs_account_number`, so an account row without one trades no crypto.
- **Orders.** These are the venue's rules, listed in the [coverage page](https://docs.taji.is/reference/coverage/robinhood-agentic.md) and [Order handling](https://docs.taji.is/catalog/robinhood-agentic.md#order-handling):
  - Sessions are `regular_hours`, `extended_hours` and `all_day_hours`. Outside regular hours only a plain limit is accepted.
  - `Pre` and `Post` alone have no venue word and are refused.
  - An option order is single-leg, in whole contracts, in the regular session or `regular_curb_overnight_hours`, never extended.
  - An OCO goes over held shares only, in regular hours, one deep.
- **Symbology.**
  - An equity is its ticker.
  - A crypto pair is dashed (`BTC-USD`, `taji_robinhood_reads::spell`).
  - An option is resolved from its OCC terms to Robinhood's instrument UUID through `get_option_instruments`, once per subscription. An index chain is spread over its sibling chains (`SPX`/`SPXW`, `NDX`/`NDXP`, `RUT`/`RUTW`).
  - An index is `$SPX`, resolved to its venue id.
- **Not served.** No futures, forex quotes or bars, past quotes or past books (`src/offer.rs`). No tool answers them.

## Examples

**The session's first read, as sent.** From `plugins/robinhood-agentic/tests/egress/read.txt`, a golden recorded against a loopback upstream with synthetic credentials. Headers are trimmed and the synthetic tokens masked.

```
http POST /oauth2/token/
content-type: application/x-www-form-urlencoded
body grant_type=refresh_token&client_id=p1&refresh_token=p2&resource=https%3A%2F%2Fagent.robinhood.com%2Fmcp%2Ftrading

http POST /mcp/trading
authorization: Bearer p3
body {"id":2,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"taji-robinhood","version":"0.1.0"},"protocolVersion":"2025-06-18"}}

http POST /mcp/trading
mcp-protocol-version: 2025-06-18
body {"jsonrpc":"2.0","method":"notifications/initialized"}

http POST /mcp/trading
body {"id":1,"jsonrpc":"2.0","method":"tools/call","params":{"arguments":{},"name":"get_accounts"}}

http POST /mcp/trading
body {"id":3,"jsonrpc":"2.0","method":"tools/call","params":{"arguments":{"symbols":["AAPL"]},"name":"get_equity_quotes"}}
```

`tests/egress/rotation.txt` shows the second grant sending the rotated refresh token, not the first one.

**An income read.** The Taji call is `GET /get/fundamentals?symbols=equity:AAPL&kind=income&provider=robinhood-agentic`. `market::income_calls` turns it into two `get_financials` calls, `period` `annual` then `quarterly`, each with `limit` 40. The answer frames, shaped as the tool's with their figures made up, from `plugins/robinhood-agentic/tests/fixtures/financials.json`, trimmed:

```json
{"annual": {"data": {"results": [{"symbol": "AAPL", "period": "annual", "financials": [
  {"fiscal_year": 2026, "fiscal_quarter": null, "period_end_date": "2026-09-26",
   "revenue": "400000000000.000000", "gross_profit": "200000000000.000000",
   "net_income": "100000000000.000000", "net_margin": "25.000000"}, …]}]}},
 "quarterly": {"data": {"results": [{"symbol": "AAPL", "period": "quarterly", "financials": [
  {"fiscal_year": 2026, "fiscal_quarter": 4, "period_end_date": "2026-09-26",
   "revenue": "100000000000.000000", …}, …]}]}}}
```

The kernel answers `provider: "robinhood-agentic"` with four rows, one per period. Each row has `symbol`, `period`, `fiscal_year`, `fiscal_quarter`, `period_end_date`, and numeric `revenue`, `gross_profit` and `net_income`. Decimal text becomes a number (`engine/crates/taji-trading/src/hub/agentic_tests/income.rs`).

**An equity OCO, as sent.** From the test body `an_oco_is_reviewed_then_placed_under_the_intents_ref` in `src/mcp/broker.rs`. A sell OCO over 10 held AAPL shares sends the review, then the place with the intent's `ref_id`:

```json
["review_advanced_order", {"account_number": "<ACCT>", "symbol": "AAPL", "side": "sell",
  "quantity": "10", "take_profit_limit_price": "120", "stop_loss_stop_price": "90",
  "time_in_force": "gtc", "market_hours": "regular_hours"}]
["place_advanced_order", {…the same…, "ref_id": "p1"}]
```

The place answers the group, its legs by id alone, as measured 2026-11-20:

```json
{"advanced_order": {"id": "p2", "contingency_type": "oco", "state": "new",
  "advanced_order_links": [{"order_id": "p3", "is_primary": false},
                           {"order_id": "p4", "is_primary": false}]}}
```

**The account as the kernel serves it.** A bound Agentic account in `GET /read/trading/book`, from `engine/crates/taji/tests/fixtures/wire/trading-book.json`, trimmed:

```json
{"brokerage": "robinhood-agentic", "arm": "live", "kind": "cash", "margin": null,
 "classes": ["equity", "option", "crypto"], "equity": "10000.00", "cash": "5000.00",
 "buying_power": "5000", "state": "bound", "id": "p1", "tail": "p2", …}
```

No live order exchange is captured. `TAJI_RH_CAPTURE_DIR` on the strategy's live-order walk would write one.

## Testing

- **Offline: `cargo test -p taji-robinhood`.** It needs no key and no network: every request is answered by `wiremock` or the egress harness. It covers:
  - the unit tests in each module;
  - the byte goldens in `tests/egress/`, which also assert that no order or agent tool name was sent;
  - `tests/official_schema.rs`: every listed tool is spellable or named as not Taji's, every emitted argument conforms to its `inputSchema`, and every declared property is sendable;
  - `tests/mcp_wire_shape.rs`.

  When Robinhood's tool list moves, refresh `tests/fixtures/tools-list.json` and the schema tests name each drift.
- **The hub against a fake Agentic.** `engine/crates/taji-trading/src/hub/agentic_tests/` covers chains, income and raw reads, and `engine/crates/taji-trading/src/arms.rs` tests the bind refusal and the absence of paper. Run them with `cargo test -p taji-trading --lib`.
- **Live, reads only.** `TAJI_LIVE_SIGNIN=1 cargo test -p taji-open --test robinhood_agentic_live -- --ignored --test-threads=1`. It runs the kernel's own sign-in once, so you complete the consent screen in your browser. Tokens stay in memory, and the tests check the hour tiers on SPY. Without the flag each test prints SKIP. `engine/crates/taji-open/scripts/vendor_live.sh` runs this leg with the others.
- **Orders.** There is no paper account, so no automated test places an order. Every order walk is live, during regular hours, with you present and giving a fresh yes.

## References

- [Agentic Trading overview](https://robinhood.com/us/en/support/articles/agentic-trading-overview/), fetched 2026-12-02
- [Onboarding an external agent](https://robinhood.com/us/en/support/articles/onboarding-an-external-agent/), fetched 2026-12-02
- [Trading with your agent](https://robinhood.com/us/en/support/articles/trading-with-your-agent/), fetched 2026-12-02
- [Robinhood Agents](https://robinhood.com/us/en/agentic-trading/), fetched 2026-12-02
- [MCP transports, 2025-06-18](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports), fetched 2026-12-02
- [MCP authorization, 2025-06-18](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization), fetched 2026-12-02
- [RFC 7591, OAuth 2.0 Dynamic Client Registration](https://datatracker.ietf.org/doc/html/rfc7591), cited by the MCP authorization page
