Repository navigation
feat(mcp): trade and read tastytrade, Saxo Bank and Kalshi accounts - #12
Merged
Merged
Conversation
rest-api now lists, reads and trades these accounts through the CPZ gateway (CPZ-Lab/cpzai#1765). The MCP tools need three things to use it: - place_order takes tastytrade's order symbols (a future /ESZ6, a futures option ./ESZ6 E1AZ6 261205P3720, a space-padded OCC option), an optional client_order_id (the idempotency key, max 50) and an optional position_effect ("open" confirms a tastytrade sell-to-open), and gets a 60 s budget: a gateway order can take up to 45 s. - list_positions takes a broker filter and says that a broker that could not be read is named in account_errors. - list_accounts names the brokers it now covers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Chris: "Simons and mcp must see it too". CPZ-Lab/cpzai#1765 makes rest-api list, read and trade Saxo Bank, tastytrade and Kalshi accounts through the CPZ gateway. The MCP tools still could not use it:
place_order's symbol rejects tastytrade futures and options. It must start with a letter or digit and cannot contain spaces, so/ESZ6,./ESZ6 E1AZ6 261205P3720andAAPL 261016C00200000all failed validation.client_order_id, so a timed-out order could not be reconciled.position_effect, which tastytrade now requires to write an option.What
orderSymbol(forplace_orderonly): the old pattern, plus an optional leading/or./and internal spaces, max 48. Data tools keep the strictersymbol.place_ordergains:client_order_id(1 to 50 of[A-Za-z0-9._:-]);position_effect(open|close);client_order_idafter a timeout.list_positions: abrokerfilter, and it says a broker that could not be read comes back inaccount_errors, never as an empty book.list_accounts: the broker filter text names the brokers it now covers.tool-catalog.json: regenerated (npm run export:catalog).Verified
vitest: 234/234. New cases:client_order_idandposition_effectare forwarded;;are all refused before any API call;brokerfilter is forwarded onlist_positions.tsc --noEmitis clean.Deploy
After CPZ-Lab/cpzai#1765 is deployed (rest-api + cpz). Until then the new fields are harmless: rest-api ignores them for other brokers.