Skip to main content
An MCP client that supports streamable HTTP and custom request headers can ask which of your rules a change would put outside range. Allocait cannot approve, stop or place an order. Your own code decides what happens next. Illustrative example. The figures are hypothetical, not a recommendation. Before you start, create an API key: in Allocait, go to Settings > API keys and select Create API key (see Create a key). A Read only key is enough, because the check only reads. Then add the server to your client with the key in the x-api-key header. Field names vary by client. This shape is an example; see your client’s documentation for its own. If your client signs in with OAuth instead, see Connect an agent.
Call list_portfolios for the portfolio_id, then check_trades:
prices covers every held and every changed symbol, except a held option with a stored mark. Allocait supplies none. A missing one fails with PRICES_INCOMPLETE and missing. Read these fields in the result:
  • newly_or_further_outside_count: how many rules the change puts outside range or leaves further outside.
  • rules_judged_count: how many rules the check judged. If it is 0, nothing was checked, so a count of 0 means nothing.
  • not_covered: symbols no rule judged.
  • within_rules and cash.sufficient: whether the book stays inside its rules and cash stays at or above 0.
A bot that proceeds only when the change adds no violation checks that the count is 0 and rules_judged_count is above 0, and decides for itself what to do about not_covered. A failed call is no result. In a loop, send each proposed basket in one call: trades takes up to 50 changes and checks them together against the book as recorded. Compare the count and log positions_updated_at with each result. If the portfolio has no active scenario, pass scenario_id from list_portfolios. Allocait offers a check_a_change prompt, which tells the agent to report rule facts only. Whether a client shows prompts is up to the client.

Next steps