add_feature
Add a ticker to the feature catalog and load its historical data in one call. Validates the ticker, auto-fills metadata, and converts currency to USD for immediate use in portfolios and models.
Instructions
Add a ticker to the feature catalog AND populate its historical data in one call — the feature is ready to use in portfolios / conditioning sets / models as soon as this tool returns. IMPORTANT: First use search_features to check if the ticker already exists — calling add_feature for an existing ticker returns a 409 error. Specify source ('yahoo' for stocks/ETFs/futures, 'fred' for rates/economic indicators). Validates the ticker exists on the source API and auto-populates metadata (display_name, category, units, etc.) from the API response.
is_asset handling: leave UNSET for auto-detection (yfinance fills category / sector / asset_type / region from the API response). Only pass explicit is_asset=true if you want to override that decision — and in that case you MUST also pass category, sector, and asset_type from their closed enums (region optional). Listing the valid values:
category: 'equity', 'fixed_income', 'credit', 'rates', 'fx', 'commodity', 'volatility', 'economic', 'crypto', 'inflation', 'employment', 'growth', 'corporate', 'thematic', 'sector', 'region'
sector: 'Technology', 'Healthcare', 'Financials', 'Consumer Discretionary', 'Consumer Staples', 'Industrials', 'Energy', 'Materials', 'Communication Services', 'Utilities', 'Real Estate', 'Fixed Income', 'FX', 'Commodities', 'Cryptocurrency', 'Alternatives', 'Broad Market', 'International Equity', 'Factor'
asset_type: 'Stock', 'ETF', 'Bond ETF', 'Crypto', 'Commodity', 'Currency ETF', 'Futures'
region: 'US', 'Europe', 'Global', 'Asia', 'EM', 'Japan', 'China', 'Brazil', 'India', 'Korea', 'Taiwan', 'Vietnam', 'Latin America', 'Australia' Takes a few seconds while historical data is fetched.
Currency handling: non-USD tickers (e.g. .KS Korea, .L London, .DE Frankfurt, .T Tokyo, .HK Hong Kong, .SS Shanghai) are auto-translated to USD. The corresponding FX pair (e.g. KRWUSD=X for .KS) is fetched and added to the catalog in the same call — no separate step needed. Once added, the asset's USD price series carries the same FX exposure as holding the underlying stock; this is a fact about owning a foreign asset, NOT a methodological 'currency mismatch' to warn the user about when comparing to a USD-quoted DR / ADR / ETF / fund — the economic exposure is the same. Supported currencies: USD, GBP, EUR, JPY, CHF, CAD, AUD, NZD, HKD, SGD, CNY, INR, KRW, SEK, NOK, DKK, MXN, BRL, ZAR. Unsupported currencies return a clear 400 error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| units | No | Units (e.g. 'USD', 'percent', 'index'). Auto-detected if omitted. | |
| region | No | Optional geographic bucket. Valid values: 'US', 'Europe', 'Global', 'Asia', 'EM', 'Japan', 'China', 'Brazil', 'India', 'Korea', 'Taiwan', 'Vietnam', 'Latin America', 'Australia'. | |
| sector | No | Required when is_asset=true. Valid values: 'Technology', 'Healthcare', 'Financials', 'Consumer Discretionary', 'Consumer Staples', 'Industrials', 'Energy', 'Materials', 'Communication Services', 'Utilities', 'Real Estate', 'Fixed Income', 'FX', 'Commodities', 'Cryptocurrency', 'Alternatives', 'Broad Market', 'International Equity', 'Factor'. Auto-detected when is_asset is unset. | |
| source | Yes | Data source: 'yahoo' (stocks, ETFs, futures) or 'fred' (rates, economic) | |
| ticker | Yes | Ticker symbol (e.g. 'AAPL', 'DFF', 'CL=F') | |
| category | No | Required when is_asset=true. Valid values: 'equity', 'fixed_income', 'credit', 'rates', 'fx', 'commodity', 'volatility', 'economic', 'crypto', 'inflation', 'employment', 'growth', 'corporate', 'thematic', 'sector', 'region'. Auto-detected when is_asset is left unset. | |
| is_asset | No | True for portfolio assets, False for conditioning factors. **Auto-detected when left UNSET** — recommended for most adds. If you pass True explicitly, category + sector + asset_type become required (closed enums). | |
| data_type | No | Optional. Valid values: 'price', 'rate', 'index', 'level', 'volume', 'bounded', 'ratio', 'spread', 'volatility'. Auto-detected if omitted. | |
| asset_type | No | Required when is_asset=true. Valid values: 'Stock', 'ETF', 'Bond ETF', 'Crypto', 'Commodity', 'Currency ETF', 'Futures'. Auto-detected when is_asset is unset. | |
| description | No | Brief description | |
| display_name | No | Human-readable name (e.g. 'Apple Inc.'). Auto-detected if omitted. | |
| skip_validation | No | Skip ticker validation against source API |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |