query
Retrieve point-in-time stock, ETF, and crypto snapshots or history with fields, filters, dates, and ranges to build ranked screens and store large pulls for later analysis.
Instructions
Any cross-section or history (one ticker's full snapshot: get_summary). Give fields and filters (names from get_schema), then EITHER date (default latest) OR start+end. One date with filters, tickers, sort_by or limit: a ranked screen. One date with only fields: every asset. A range: every row in it, weekly by default past ~6 months; market_/macro_ filters keep only dates in that regime, other filters apply after the rows are fetched, so narrow with tickers, member_of or asset_class. Big pulls: store_as + fetch_all, then query_data.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Range end (YYYY-MM-DD). | |
| date | No | One date; default latest (YYYY-MM-DD). | |
| limit | No | Rows on one date (default 20, max 250); rows per page on a range. | |
| ohlcv | No | Range only: add ohlcv_open/high/low/close/volume. | |
| start | No | Range start, with end (YYYY-MM-DD). | |
| append | No | Add rows to an existing store_as table instead of replacing it. | |
| fields | No | Columns, e.g. ["market_cap_usd","momentum_rsi_zone"]. Max 30. | |
| offset | No | One date: skip this many ranked rows. | |
| dry_run | No | Range: returns what it would cost in credits. No data, no charge. | |
| filters | No | Up to 10; a row must match all of them, and null matches none. E.g. [{"field":"momentum_rsi_zone","op":"in","value":["oversold"]}]. | |
| held_by | No | Only assets this fund held on the row's date: fund ticker (IVV) or SEC series id. | |
| sort_by | No | Ticker field to rank by (one date). | |
| tickers | No | Only these tickers. | |
| store_as | No | Table name: store rows in SQLite, return only a summary. Read with query_data. | |
| fetch_all | No | Follow every page into store_as in this one call. | |
| member_of | No | Only members of this index on the row's date, e.g. sp500. Ids: get_indexes. | |
| timeframe | No | Default: weekly for ranges over ~6 months, else daily. | |
| adjustment | No | With ohlcv: split (default), split_dividend (total return) or raw (as traded). | |
| page_token | No | Range: a token from page_tokens or next_page_token (same params). | |
| asset_class | No | Only this asset class. | |
| sort_direction | No | Default desc. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | The tool's result. |