Stock comparison and weight in an ETF
compare_stocksUse this when the user asks how two US stocks compare on size, valuation, returns, risk or correlation, or what weight and rank one stock has inside one named ETF, for example META in QQQ. For two stocks it returns market cap, P/E and dividend yield from market data, returns, volatility, worst fall, beta, the correlation of weekly returns over up to three years and the covered ETFs holding both. For a stock and an ETF it returns whether the ETF holds the stock, at what weight and rank among the shares it holds outright, with the date of the ETF's holdings; a derivative-based ETF's swaps, futures and options are in its profile (get_etf_holdings), not here. A stock is in the data with about two years of US prices, and sooner for a recent listing a covered ETF holds. Returns are past, not a forecast. Not for comparing two ETFs (compare_etfs), or a company's business or products.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"a": "<a>",
"b": "<b>"
},
"name": "compare_stocks"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | A US stock ticker, for example NVDA. An ETF ticker also works on one side, for example QQQ. | |
| b | Yes | The other ticker, for example AMD. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pair | No | ||
| source | No | ||
| covered | No | ||
| membership | No | For a stock and an ETF. | |
| weeks_used | No | ||
| not_in_data | No | ||
| prices_as_of | No | ||
| correlation_3y | No | ||
| funds_holding_both | No | ||
| funds_holding_both_count | No |