{"openapi":"3.1.0","info":{"title":"Trade It API","version":"1.0.0","description":"Read brokerage accounts and holdings, create reviewable orders, and execute approved trades. Authenticate with a user API key or per-user OAuth token.","contact":{"name":"Trade It","url":"https://tradeit.app/llm-resources"}},"servers":[{"url":"https://api.tradeit.app"}],"x-supported-brokerages":{"all":["Charles Schwab","Coinbase","ETrade","Kraken","Moomoo","Public","Robinhood","Tastytrade","TradeStation","TradeStation Paper","Webull"],"equitiesAndOptions":["Charles Schwab","ETrade","Moomoo","Public","Robinhood","Tastytrade","TradeStation","TradeStation Paper","Webull"],"crypto":["Coinbase","Kraken","Public"]},"security":[{"OAuth2":["tool:execute"]},{"TradeItApiKey":[]}],"paths":{"/api/brokerageConnection/{id}":{"delete":{"operationId":"deleteConnection","externalDocs":{"url":"https://docs.tradeit.app/api/delete-connection"},"summary":"Delete a brokerage connection and its accounts","description":"Deletes the authenticated user’s brokerage connection, all accounts on that connection, and their stored trades in Trade It. Currently applies to the entire connection across Trade It and all partners, regardless of which client created the token. Use connection.id or account.connection_id from get_accounts. Requires a user bearer token with brokerage:write; organization client credentials are not accepted. Sends ACCOUNT_DELETED webhooks for the deleted accounts to subscribed partners. Does not remove organization membership or revoke OAuth authorization.","security":[{"OAuth2":["brokerage:write"]},{"TradeItApiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Trade It brokerage connection ID, returned as connection.id or account.connection_id by get_accounts.","schema":{"type":"integer","minimum":1},"example":395}],"responses":{"200":{"description":"Connection and associated records deleted.","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean","const":true}}},"example":{"success":true}}}},"401":{"description":"Invalid or expired bearer token."},"403":{"description":"The caller cannot access the connection or lacks brokerage:write permission."},"404":{"description":"Connection not found."}}}},"/api/partner/membership":{"delete":{"operationId":"removeMembership","externalDocs":{"url":"https://docs.tradeit.app/api/remove-membership"},"summary":"Remove a member using organization client credentials","description":"Authenticate with HTTP Basic using the organization’s client_id and client_secret. Supply the target member’s Trade It user_id in the JSON body. A user access token is not required, so removal works after user authorization is revoked or tokens expire. Uses the same sponsorship cleanup and last-admin protection as administrator member removal. Current-cycle usage remains billable; removed members do not carry into future billing cycles unless they rejoin. Does not revoke OAuth authorization or delete brokerage connections or accounts.","security":[{"PartnerClientCredentials":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"user_id":{"description":"The Trade It user ID of the organization member to remove.","type":["number","string"]}},"required":["user_id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Membership removed.","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean","const":true}}},"example":{"success":true}}}},"400":{"description":"Invalid user_id or request body, or the member is the organization’s last administrator."},"401":{"description":"Missing or invalid HTTP Basic client credentials."},"404":{"description":"The organization or active membership was not found."}}}},"/api/tool/execute":{"post":{"operationId":"executeTool","externalDocs":{"url":"https://docs.tradeit.app/api"},"summary":"Execute a Trade It tool","description":"Select an operation with tool_name and supply its params. The legacy toolName alias remains supported; tool_name takes precedence when both are supplied. The response is the operation result, without a result wrapper. Review and obtain explicit user approval before submitting a live trade. Accounts configured for automatic execution may submit during creation; inspect returned order state.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["tool_name","params"],"properties":{"tool_name":{"type":"string","const":"search_assets"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"query":{"type":"string","minLength":1,"description":"The ticker symbol or name of the asset"}},"required":["query"]}},"description":"Look up a stock or crypto asset by ticker symbol or name. Returns price and asset metadata."},{"type":"object","required":["tool_name","params"],"properties":{"tool_name":{"type":"string","const":"get_option_chain"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"root_symbol":{"type":"string","minLength":1,"description":"Underlying asset symbol, e.g. AMZN"},"expiration_date_gte":{"description":"Filter by expiration date greater than or equal to this YYYY-MM-DD date","type":"string"},"expiration_date_lte":{"description":"Filter by expiration date less than or equal to this YYYY-MM-DD date","type":"string"},"type":{"description":"Filter by call or put","type":"string","enum":["call","put"]},"strike_price_gte":{"description":"Filter by strike price greater than or equal to this value","type":"string"},"strike_price_lte":{"description":"Filter by strike price less than or equal to this value","type":"string"},"delta_gte":{"description":"Filter by absolute value delta greater than or equal to this value","type":"number"},"delta_lte":{"description":"Filter by absolute value delta less than or equal to this value","type":"number"},"greeks":{"default":false,"description":"When true, include delta/gamma/theta/rho/vega on each contract","type":"boolean"},"limit":{"description":"Max number of contracts to return after filtering","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["root_symbol"]}},"description":"Search option chain by underlying symbol, option type, expiration range, strike range, and absolute delta range. Returns OCC symbols with bid and ask. If the user mentions delta, you must set greeks true, set delta_gte and delta_lte as an absolute decimal range around the target. e.g. 16 delta -> delta_gte 0.15, delta_lte 0.17. Do not call this tool without delta_gte/delta_lte for delta-based requests."},{"type":"object","required":["tool_name","params"],"properties":{"tool_name":{"type":"string","const":"create_trade"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"symbol":{"type":"string","minLength":1,"description":"Ticker symbol of the asset to trade, e.g. TSLA"},"amount":{"type":"number","exclusiveMinimum":0,"description":"How much to trade: a dollar value when unit is dollars, or a share count when unit is shares."},"unit":{"type":"string","enum":["dollars","shares"],"description":"Whether amount is in dollars or shares."},"buy_or_sell":{"type":"string","enum":["buy","sell"],"description":"Whether to buy or sell the asset."},"metadata":{"description":"Optional context displayed with the draft trade.","type":"object","properties":{"image_url":{"description":"Link to the screenshot or chart the user shared as the source of this trade idea, shown alongside the draft.","type":"string"}}},"order_type":{"description":"How the order is priced. Omit for a market order.","type":"string","enum":["market","limit","stop","stop_limit"]},"limit_price":{"description":"Maximum price per share to pay on a buy, or minimum to accept on a sell, in the asset currency. Set for limit and stop_limit orders.","type":"number","exclusiveMinimum":0},"stop_price":{"description":"Price per share, in the asset currency, that triggers the order. Set for stop and stop_limit orders.","type":"number","exclusiveMinimum":0},"take_profit":{"description":"Take-profit exit for Buy entries or OCO Sell orders. Not supported by all brokerages.","type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"description":"Exit trigger level"},"unit":{"default":"$","description":"Absolute price ($) or percent from entry price (%).","type":"string","enum":["$","%"]}},"required":["value"]},"stop_loss":{"description":"Stop-loss exit for Buy entries or OCO Sell orders. Not supported by all brokerages.","type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"description":"Exit trigger level"},"unit":{"default":"$","description":"Absolute price ($) or percent from entry price (%).","type":"string","enum":["$","%"]}},"required":["value"]},"time_in_force":{"description":"How long the order stays open: day expires at market close, gtc stays open until canceled. Omit to use the brokerage default.","type":"string","enum":["day","gtc","ioc","fok"]},"account_id":{"description":"ID of the brokerage account to trade in, from get_accounts. Omit to use the user's default account.","type":["number","string"]}},"required":["symbol","amount","unit","buy_or_sell"]}},"description":"Create a draft stock or crypto trade order for user to review.\nUse for single-leg equity or crypto buy/sell orders.\nThis tool returns a draft order only; brokerage execution requires a separate tool."},{"type":"object","required":["tool_name","params"],"properties":{"tool_name":{"type":"string","const":"create_options_trade"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"symbol":{"type":"string","minLength":1,"description":"Ticker symbol of the underlying asset, e.g. SPX or TSLA"},"legs":{"minItems":1,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["option","equity"],"description":"Whether the leg trades an option contract or shares of the underlying."},"action":{"type":"string","enum":["buy","sell"],"description":"Whether the leg buys or sells."},"position_effect":{"description":"Whether an option leg opens a new position or closes an existing one. Use null for equity legs.","anyOf":[{"type":"string","enum":["open","close"]},{"type":"null"}]},"occ":{"description":"Option contract in OCC format without the root symbol: YYMMDD, C or P, then the strike x1000 zero-padded to 8 digits, e.g. \"240119C00195000\" for the Jan 19, 2024 $195 call. Use null for equity legs.","type":["string","null"]},"quantity":{"type":"number","exclusiveMinimum":0,"description":"Number of contracts for options or shares for equity"}},"required":["type","action","occ","quantity"]},"description":"Array of trade legs. At least one leg is required."},"direction":{"description":"Net cash flow of a multi-leg spread: debit when paying, credit when receiving, even for zero-net. Set for multi-leg spreads only.","type":"string","enum":["debit","credit","even"]},"limit_price":{"description":"Net price per spread unit for limit and stop_limit orders, in the asset currency. Use 0 with direction even for a zero-net spread.","type":"number","minimum":0},"order_type":{"description":"How the order is priced. Omit for a market order.","type":"string","enum":["market","limit","stop","stop_limit"]},"stop_price":{"description":"Price per share, in the asset currency, that triggers the order. Set for stop and stop_limit orders.","type":"number","exclusiveMinimum":0},"time_in_force":{"description":"How long the order stays open: day expires at market close, gtc stays open until canceled. Omit to use the brokerage default.","type":"string","enum":["day","gtc","ioc","fok"]},"account_id":{"description":"ID of the brokerage account to trade in, from get_accounts. Omit to use the user's default account.","type":["number","string"]}},"required":["symbol","legs"]}},"description":"Create a draft options trade order with one or more concrete legs.\nUse for single options, vertical spreads, and mixed equity/option strategies.\nOption legs require OCC symbols. Equity legs use occ: null.\nThis tool returns a draft order only; brokerage execution is a separate tool."},{"type":"object","required":["tool_name","params"],"properties":{"tool_name":{"type":"string","const":"create_trade_link"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"config":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"description":"Ticker symbol of the asset, or the underlying for options, e.g. TSLA"},"trade_type":{"default":0,"description":"0 for a single buy or sell using action, amount, and unit; 1 for an options or multi-leg trade using legs and direction.","type":"number","enum":[0,1]},"action":{"description":"Whether a simple trade buys or sells. Set when trade_type is 0.","type":"string","enum":["buy","sell"]},"amount":{"description":"How much a simple trade buys or sells,, as dollars or shares per unit.","type":"number","exclusiveMinimum":0},"unit":{"default":"dollars","description":"Whether amount is a dollar value or a share count.","type":"string","enum":["dollars","shares"]},"direction":{"description":"Net cash flow of a multi-leg trade: debit when paying, credit when receiving, even for zero-net.","type":"string","enum":["debit","credit","even"]},"legs":{"description":"Legs of an options or multi-leg trade. Set when trade_type is 1.","type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["option","equity"],"description":"Whether the leg trades an option or the underlying stock."},"action":{"type":"string","enum":["buy","sell"],"description":"Whether the leg buys or sells."},"position_effect":{"anyOf":[{"type":"string","enum":["open","close"]},{"type":"null"}],"description":"Whether the leg opens or closes a position."},"occ":{"description":"OCC option contract symbol, e.g. 260717C00435000. Null for stock legs.","type":["string","null"]},"quantity":{"type":"number","description":"Number of option contracts, or shares for a stock leg."}},"required":["type","action","position_effect","occ","quantity"]}},"order_type":{"default":"market","description":"How the order is priced. Omit for a market order.","type":"string","enum":["market","limit","stop","stop_limit"]},"limit_price":{"description":"Limit price in the asset currency for limit and stop_limit orders; per spread unit for multi-leg trades, where 0 with direction even means zero-net.","type":"number","minimum":0},"stop_price":{"description":"Price in the asset currency that triggers stop and stop_limit orders.","type":"number","exclusiveMinimum":0},"time_in_force":{"description":"How long the order stays open: day expires at market close, gtc stays open until canceled. Omit to use the brokerage default.","type":"string","enum":["day","gtc","ioc","fok"]},"take_profit":{"description":"Take-profit exit for bracket Buy entries or OCO Sell orders. Not supported by all brokerages.","type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"description":"Exit trigger level"},"unit":{"default":"$","description":"Absolute price ($) or percent from entry price (%).","type":"string","enum":["$","%"]}},"required":["value"]},"stop_loss":{"description":"Stop-loss exit for  bracket Buy entries or OCO Sell orders. Not supported by all brokerages.","type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"description":"Exit trigger level"},"unit":{"default":"$","description":"Absolute price ($) or percent from entry price (%).","type":"string","enum":["$","%"]}},"required":["value"]},"utm_referred":{"description":"Referral source label stored with the link for tracking, e.g. a newsletter name.","type":"string"}},"required":["ticker"]}},"required":["config"]}},"description":"Prepare a stock, crypto, or options trade as a shareable link for the user's approval. The link opens in-browser, where they can review, edit, and place the trade in one click through any of their connected brokerages. This tool only creates the link; submitting an order requires the user's action."},{"type":"object","required":["tool_name","params"],"properties":{"tool_name":{"type":"string","const":"get_accounts"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"refresh":{"description":"When true, requests the freshest available brokerage data. Real-time refresh requires a Pro plan and has a 1 minute per-account cooldown. Omit or false to return the last synced data.","type":"boolean"}}}},"description":"List the user's linked brokerage accounts with each account's ID, name, brokerage, total value, cash, buying power, and fractional share support. Use the returned IDs with other tools. Use refresh=true to request fresh balances when eligible. Currently supported: Charles Schwab, Coinbase, ETrade, Kraken, Moomoo, Public, Robinhood, Tastytrade, TradeStation, TradeStation Paper, Webull"},{"type":"object","required":["tool_name","params"],"properties":{"tool_name":{"type":"string","const":"get_holdings"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"account_id":{"description":"ID of the brokerage account to inspect, from get_accounts.","type":["number","string"]},"refresh":{"description":"When true, requests the freshest available brokerage data. Real-time refresh requires a Pro plan and has a 1 minute per-account cooldown. Omit or false to return the last synced data.","type":"boolean"}},"required":["account_id"]}},"description":"List the positions held in a brokerage account with each symbol, asset type, quantity, and average cost. Use refresh=true to request fresh brokerage data when eligible."},{"type":"object","required":["tool_name","params"],"properties":{"tool_name":{"type":"string","const":"get_trades"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"limit":{"description":"Number of trades to return per page. Omit for 12.","type":"integer","exclusiveMinimum":0,"maximum":100},"cursor":{"description":"Cursor from a previous get_trades response. Pass next_cursor to continue paginating older trades.","type":["number","string"]},"refresh":{"description":"When true, requests the freshest available brokerage data. Real-time refresh requires a Pro plan and has a 1 minute per-account cooldown. Omit or false to return the last synced data.","type":"boolean"}}}},"description":"Get the user's recent trades with cursor pagination. Use refresh=true to request fresh brokerage sync when eligible."},{"type":"object","required":["tool_name","params"],"properties":{"tool_name":{"type":"string","const":"image_to_assets"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"imageBase64":{"type":"string","minLength":1,"description":"Base64 encoded image data to analyze"}},"required":["imageBase64"]}},"description":"Analyzes an image to identify companies or cryptocurrencies and returns structured asset information with prices."},{"type":"object","required":["tool_name","params"],"properties":{"tool_name":{"type":"string","const":"execute_trade"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"trade_id":{"description":"ID of the draft trade to execute, as returned by create_trade or create_options_trade.","type":["number","string"]}},"required":["trade_id"]}},"description":"Execute a draft trade order by trade ID. Use only after the user explicitly requests to execute the specific trade.\n    DO NOT call this immediately after create_trade or create_options_trade; the user must review and confirm first."},{"type":"object","required":["tool_name","params"],"properties":{"tool_name":{"type":"string","const":"cancel_trade"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"trade_id":{"description":"ID of the trade to cancel, from create_trade, create_options_trade, or get_trades.","type":["number","string"]}},"required":["trade_id"]}},"description":"Cancel a draft or cancellable brokerage order by trade ID.\nFor a submitted order, cancellation is requested from the brokerage and may race with an in-progress fill."},{"type":"object","required":["toolName","params"],"properties":{"tool_name":{"type":"null"},"toolName":{"type":"string","const":"search_assets","deprecated":true},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"query":{"type":"string","minLength":1,"description":"The ticker symbol or name of the asset"}},"required":["query"]}},"description":"Look up a stock or crypto asset by ticker symbol or name. Returns price and asset metadata.","deprecated":true},{"type":"object","required":["toolName","params"],"properties":{"tool_name":{"type":"null"},"toolName":{"type":"string","const":"get_option_chain","deprecated":true},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"root_symbol":{"type":"string","minLength":1,"description":"Underlying asset symbol, e.g. AMZN"},"expiration_date_gte":{"description":"Filter by expiration date greater than or equal to this YYYY-MM-DD date","type":"string"},"expiration_date_lte":{"description":"Filter by expiration date less than or equal to this YYYY-MM-DD date","type":"string"},"type":{"description":"Filter by call or put","type":"string","enum":["call","put"]},"strike_price_gte":{"description":"Filter by strike price greater than or equal to this value","type":"string"},"strike_price_lte":{"description":"Filter by strike price less than or equal to this value","type":"string"},"delta_gte":{"description":"Filter by absolute value delta greater than or equal to this value","type":"number"},"delta_lte":{"description":"Filter by absolute value delta less than or equal to this value","type":"number"},"greeks":{"default":false,"description":"When true, include delta/gamma/theta/rho/vega on each contract","type":"boolean"},"limit":{"description":"Max number of contracts to return after filtering","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["root_symbol"]}},"description":"Search option chain by underlying symbol, option type, expiration range, strike range, and absolute delta range. Returns OCC symbols with bid and ask. If the user mentions delta, you must set greeks true, set delta_gte and delta_lte as an absolute decimal range around the target. e.g. 16 delta -> delta_gte 0.15, delta_lte 0.17. Do not call this tool without delta_gte/delta_lte for delta-based requests.","deprecated":true},{"type":"object","required":["toolName","params"],"properties":{"tool_name":{"type":"null"},"toolName":{"type":"string","const":"create_trade","deprecated":true},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"symbol":{"type":"string","minLength":1,"description":"Ticker symbol of the asset to trade, e.g. TSLA"},"amount":{"type":"number","exclusiveMinimum":0,"description":"How much to trade: a dollar value when unit is dollars, or a share count when unit is shares."},"unit":{"type":"string","enum":["dollars","shares"],"description":"Whether amount is in dollars or shares."},"buy_or_sell":{"type":"string","enum":["buy","sell"],"description":"Whether to buy or sell the asset."},"metadata":{"description":"Optional context displayed with the draft trade.","type":"object","properties":{"image_url":{"description":"Link to the screenshot or chart the user shared as the source of this trade idea, shown alongside the draft.","type":"string"}}},"order_type":{"description":"How the order is priced. Omit for a market order.","type":"string","enum":["market","limit","stop","stop_limit"]},"limit_price":{"description":"Maximum price per share to pay on a buy, or minimum to accept on a sell, in the asset currency. Set for limit and stop_limit orders.","type":"number","exclusiveMinimum":0},"stop_price":{"description":"Price per share, in the asset currency, that triggers the order. Set for stop and stop_limit orders.","type":"number","exclusiveMinimum":0},"take_profit":{"description":"Take-profit exit for Buy entries or OCO Sell orders. Not supported by all brokerages.","type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"description":"Exit trigger level"},"unit":{"default":"$","description":"Absolute price ($) or percent from entry price (%).","type":"string","enum":["$","%"]}},"required":["value"]},"stop_loss":{"description":"Stop-loss exit for Buy entries or OCO Sell orders. Not supported by all brokerages.","type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"description":"Exit trigger level"},"unit":{"default":"$","description":"Absolute price ($) or percent from entry price (%).","type":"string","enum":["$","%"]}},"required":["value"]},"time_in_force":{"description":"How long the order stays open: day expires at market close, gtc stays open until canceled. Omit to use the brokerage default.","type":"string","enum":["day","gtc","ioc","fok"]},"account_id":{"description":"ID of the brokerage account to trade in, from get_accounts. Omit to use the user's default account.","type":["number","string"]}},"required":["symbol","amount","unit","buy_or_sell"]}},"description":"Create a draft stock or crypto trade order for user to review.\nUse for single-leg equity or crypto buy/sell orders.\nThis tool returns a draft order only; brokerage execution requires a separate tool.","deprecated":true},{"type":"object","required":["toolName","params"],"properties":{"tool_name":{"type":"null"},"toolName":{"type":"string","const":"create_options_trade","deprecated":true},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"symbol":{"type":"string","minLength":1,"description":"Ticker symbol of the underlying asset, e.g. SPX or TSLA"},"legs":{"minItems":1,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["option","equity"],"description":"Whether the leg trades an option contract or shares of the underlying."},"action":{"type":"string","enum":["buy","sell"],"description":"Whether the leg buys or sells."},"position_effect":{"description":"Whether an option leg opens a new position or closes an existing one. Use null for equity legs.","anyOf":[{"type":"string","enum":["open","close"]},{"type":"null"}]},"occ":{"description":"Option contract in OCC format without the root symbol: YYMMDD, C or P, then the strike x1000 zero-padded to 8 digits, e.g. \"240119C00195000\" for the Jan 19, 2024 $195 call. Use null for equity legs.","type":["string","null"]},"quantity":{"type":"number","exclusiveMinimum":0,"description":"Number of contracts for options or shares for equity"}},"required":["type","action","occ","quantity"]},"description":"Array of trade legs. At least one leg is required."},"direction":{"description":"Net cash flow of a multi-leg spread: debit when paying, credit when receiving, even for zero-net. Set for multi-leg spreads only.","type":"string","enum":["debit","credit","even"]},"limit_price":{"description":"Net price per spread unit for limit and stop_limit orders, in the asset currency. Use 0 with direction even for a zero-net spread.","type":"number","minimum":0},"order_type":{"description":"How the order is priced. Omit for a market order.","type":"string","enum":["market","limit","stop","stop_limit"]},"stop_price":{"description":"Price per share, in the asset currency, that triggers the order. Set for stop and stop_limit orders.","type":"number","exclusiveMinimum":0},"time_in_force":{"description":"How long the order stays open: day expires at market close, gtc stays open until canceled. Omit to use the brokerage default.","type":"string","enum":["day","gtc","ioc","fok"]},"account_id":{"description":"ID of the brokerage account to trade in, from get_accounts. Omit to use the user's default account.","type":["number","string"]}},"required":["symbol","legs"]}},"description":"Create a draft options trade order with one or more concrete legs.\nUse for single options, vertical spreads, and mixed equity/option strategies.\nOption legs require OCC symbols. Equity legs use occ: null.\nThis tool returns a draft order only; brokerage execution is a separate tool.","deprecated":true},{"type":"object","required":["toolName","params"],"properties":{"tool_name":{"type":"null"},"toolName":{"type":"string","const":"create_trade_link","deprecated":true},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"config":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"description":"Ticker symbol of the asset, or the underlying for options, e.g. TSLA"},"trade_type":{"default":0,"description":"0 for a single buy or sell using action, amount, and unit; 1 for an options or multi-leg trade using legs and direction.","type":"number","enum":[0,1]},"action":{"description":"Whether a simple trade buys or sells. Set when trade_type is 0.","type":"string","enum":["buy","sell"]},"amount":{"description":"How much a simple trade buys or sells,, as dollars or shares per unit.","type":"number","exclusiveMinimum":0},"unit":{"default":"dollars","description":"Whether amount is a dollar value or a share count.","type":"string","enum":["dollars","shares"]},"direction":{"description":"Net cash flow of a multi-leg trade: debit when paying, credit when receiving, even for zero-net.","type":"string","enum":["debit","credit","even"]},"legs":{"description":"Legs of an options or multi-leg trade. Set when trade_type is 1.","type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["option","equity"],"description":"Whether the leg trades an option or the underlying stock."},"action":{"type":"string","enum":["buy","sell"],"description":"Whether the leg buys or sells."},"position_effect":{"anyOf":[{"type":"string","enum":["open","close"]},{"type":"null"}],"description":"Whether the leg opens or closes a position."},"occ":{"description":"OCC option contract symbol, e.g. 260717C00435000. Null for stock legs.","type":["string","null"]},"quantity":{"type":"number","description":"Number of option contracts, or shares for a stock leg."}},"required":["type","action","position_effect","occ","quantity"]}},"order_type":{"default":"market","description":"How the order is priced. Omit for a market order.","type":"string","enum":["market","limit","stop","stop_limit"]},"limit_price":{"description":"Limit price in the asset currency for limit and stop_limit orders; per spread unit for multi-leg trades, where 0 with direction even means zero-net.","type":"number","minimum":0},"stop_price":{"description":"Price in the asset currency that triggers stop and stop_limit orders.","type":"number","exclusiveMinimum":0},"time_in_force":{"description":"How long the order stays open: day expires at market close, gtc stays open until canceled. Omit to use the brokerage default.","type":"string","enum":["day","gtc","ioc","fok"]},"take_profit":{"description":"Take-profit exit for bracket Buy entries or OCO Sell orders. Not supported by all brokerages.","type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"description":"Exit trigger level"},"unit":{"default":"$","description":"Absolute price ($) or percent from entry price (%).","type":"string","enum":["$","%"]}},"required":["value"]},"stop_loss":{"description":"Stop-loss exit for  bracket Buy entries or OCO Sell orders. Not supported by all brokerages.","type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"description":"Exit trigger level"},"unit":{"default":"$","description":"Absolute price ($) or percent from entry price (%).","type":"string","enum":["$","%"]}},"required":["value"]},"utm_referred":{"description":"Referral source label stored with the link for tracking, e.g. a newsletter name.","type":"string"}},"required":["ticker"]}},"required":["config"]}},"description":"Prepare a stock, crypto, or options trade as a shareable link for the user's approval. The link opens in-browser, where they can review, edit, and place the trade in one click through any of their connected brokerages. This tool only creates the link; submitting an order requires the user's action.","deprecated":true},{"type":"object","required":["toolName","params"],"properties":{"tool_name":{"type":"null"},"toolName":{"type":"string","const":"get_accounts","deprecated":true},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"refresh":{"description":"When true, requests the freshest available brokerage data. Real-time refresh requires a Pro plan and has a 1 minute per-account cooldown. Omit or false to return the last synced data.","type":"boolean"}}}},"description":"List the user's linked brokerage accounts with each account's ID, name, brokerage, total value, cash, buying power, and fractional share support. Use the returned IDs with other tools. Use refresh=true to request fresh balances when eligible. Currently supported: Charles Schwab, Coinbase, ETrade, Kraken, Moomoo, Public, Robinhood, Tastytrade, TradeStation, TradeStation Paper, Webull","deprecated":true},{"type":"object","required":["toolName","params"],"properties":{"tool_name":{"type":"null"},"toolName":{"type":"string","const":"get_holdings","deprecated":true},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"account_id":{"description":"ID of the brokerage account to inspect, from get_accounts.","type":["number","string"]},"refresh":{"description":"When true, requests the freshest available brokerage data. Real-time refresh requires a Pro plan and has a 1 minute per-account cooldown. Omit or false to return the last synced data.","type":"boolean"}},"required":["account_id"]}},"description":"List the positions held in a brokerage account with each symbol, asset type, quantity, and average cost. Use refresh=true to request fresh brokerage data when eligible.","deprecated":true},{"type":"object","required":["toolName","params"],"properties":{"tool_name":{"type":"null"},"toolName":{"type":"string","const":"get_trades","deprecated":true},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"limit":{"description":"Number of trades to return per page. Omit for 12.","type":"integer","exclusiveMinimum":0,"maximum":100},"cursor":{"description":"Cursor from a previous get_trades response. Pass next_cursor to continue paginating older trades.","type":["number","string"]},"refresh":{"description":"When true, requests the freshest available brokerage data. Real-time refresh requires a Pro plan and has a 1 minute per-account cooldown. Omit or false to return the last synced data.","type":"boolean"}}}},"description":"Get the user's recent trades with cursor pagination. Use refresh=true to request fresh brokerage sync when eligible.","deprecated":true},{"type":"object","required":["toolName","params"],"properties":{"tool_name":{"type":"null"},"toolName":{"type":"string","const":"image_to_assets","deprecated":true},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"imageBase64":{"type":"string","minLength":1,"description":"Base64 encoded image data to analyze"}},"required":["imageBase64"]}},"description":"Analyzes an image to identify companies or cryptocurrencies and returns structured asset information with prices.","deprecated":true},{"type":"object","required":["toolName","params"],"properties":{"tool_name":{"type":"null"},"toolName":{"type":"string","const":"execute_trade","deprecated":true},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"trade_id":{"description":"ID of the draft trade to execute, as returned by create_trade or create_options_trade.","type":["number","string"]}},"required":["trade_id"]}},"description":"Execute a draft trade order by trade ID. Use only after the user explicitly requests to execute the specific trade.\n    DO NOT call this immediately after create_trade or create_options_trade; the user must review and confirm first.","deprecated":true},{"type":"object","required":["toolName","params"],"properties":{"tool_name":{"type":"null"},"toolName":{"type":"string","const":"cancel_trade","deprecated":true},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"trade_id":{"description":"ID of the trade to cancel, from create_trade, create_options_trade, or get_trades.","type":["number","string"]}},"required":["trade_id"]}},"description":"Cancel a draft or cancellable brokerage order by trade ID.\nFor a submitted order, cancellation is requested from the brokerage and may race with an in-progress fill.","deprecated":true}]},"example":{"tool_name":"get_accounts","params":{}}}}},"responses":{"200":{"description":"The selected operation result. See the corresponding tool definition or API guide for its response fields."},"400":{"description":"Invalid tool or request parameters."},"401":{"description":"Missing or invalid bearer token. Follow OAuth discovery or provide a user-created API key."},"403":{"description":"Insufficient scope or plan access."},"429":{"description":"Rate limit exceeded."}}}}},"components":{"securitySchemes":{"PartnerClientCredentials":{"type":"http","scheme":"basic","description":"Use the organization’s client_id and client_secret from your server. URL-encode each value before joining with a colon and Base64-encoding."},"OAuth2":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://auth.tradeit.app/auth/v1/authorize","tokenUrl":"https://auth.tradeit.app/auth/v1/token","scopes":{"asset:read":"Read market asset metadata and prices.","brokerage:read":"Read linked brokerage accounts and balances.","brokerage:write":"Create, update, or delete brokerage connections.","trade:read":"Read trade history and order state.","trade:write":"Create draft trades and order updates.","tool:execute":"Execute Trade It MCP and agent tools.","user:read":"Read the authenticated Trade It user profile."}}}},"TradeItApiKey":{"type":"http","scheme":"bearer","description":"Create a user API key at https://tradeit.app/account/api-keys."}}}}