Skip to main content
OpenTools’ trading module combines providers that connect to trading providers, ranging from crypto to stock markets. The tools that are exposed, originate from Alpaca and Coinbase, with more providers planned soon. Output of tools are normalised through pre-defined schemas to ensure compatibility across markets where provider_fields express more granular metadata.
The trading module is currently read-only. It does not place orders or execute trades - this functionality will be added in the next update.

What tools are available?

The following tools are listed for each provider. Please note that as many or as few as you need can be added at runtime. In addition, the output for each tool is structured according to defined trading schema - this is explained further in API reference.
CapabilityAlpacaCoinbase
Get accountget_accountget_account
List accountslist_accounts
List portfolioslist_portfolios
Portfolio breakdownget_portfolio_breakdown
List positionslist_positionslist_positions
Get positionget_position
Trading clockget_clockget_clock
List assetslist_assetslist_assets
Get assetget_assetget_asset
List orderslist_orderslist_orders
Get orderget_orderget_order
Portfolio historyget_portfolio_history

What are some of the supported features?

The Trading module supports features that will be supported by all modules that are planned to be built. This includes a minimal flag, that allows for token optimisation with only schema output accepted. A strict option and demo option allows for tool outputs to be rejected or accepted depending on status code. Another feature involves the include or exclude parameter, which allows you to change what tools you want the model to see quickly. Lastly, concatenating tools from multiple providers is done simply via the + operator or the raw combine() function.

Minimal

Providers often include extra metadata that is useful for debugging but can be noisy context for LLMs and may be unnecessary for your project. Set minimal=True to omit provider metadata from returned objects. Concretely, this drops provider and provider_fields recursively from tool outputs.

Strict

OpenTools distinguishes between tool failures that should halt execution and tool failures that should be returned as structured error payloads. Use strict() for production behavior (fatal tool errors raise), and demo() for prototyping (never raise based on fatal kinds).

Paper/Live

We support switching between sandbox and production environments via a single paper flag, which is currently possibe thorugh both providers. This allows the same codepath to be used for demos, testing, and live deployments.

Include/Exclude

You can control which tools are exposed to the model at runtime using include and exclude, either when constructing a service or when bundling tools. This means you don’t have to use all the tools or you can choose not to include certain ones at runtime.

Combining providers

Multiple trading providers can be combined into a single tool surface using the + operator. This allows you to use a unified service that exposes tools from all combined providers while preserving a single model and framework context. This can be done as simply as tools = alpaca_tools + coinbase_tools

Framework compatibility

Trading services can optionally be bound to a specific agent framework using, for example, framework="langgraph". When set, tools are exposed in a framework-native format without changing provider or domain logic.

Next steps