create_query
ChatGPTSaves a private named query or batch. Text must compile; saving pins every use line to its library digest and records version 1. Names are unique per owner, case-insensitively. Identical input with the same idempotency_key replays the receipt within 24 hours, including after uncertain outcomes. Changed input with the same key fails.
delete_query
ChatGPTPermanently deletes an owned saved query and all its version history by UUID. This cannot be undone. A repeated delete returns not-found.
list_queries
ChatGPTList your saved queries, newest updated first. Takes no arguments.
list_query_versions
ChatGPTLists append-only versions of an owned saved query by UUID, newest first, with version, name, description, text, digest and created_at. run_saved_query with version runs old text; update_query with old text and the current version as expected_version creates a new version restoring it.
run_query
ChatGPTMonkQL: US stock/futures quotes, charts, scans, filings, insider trades, news, fundamentals. Research only; no orders. Defaults: stocks/all, daily regular. Clause order is free; fn/let keep their order. from names quoted symbols or universe <slug>; from stocks/futures alone selects that market’s universe all. Scans need where or sort; named symbols need neither. include sets rank/percentile population; where filters afterward. sort is numeric asc/desc; take defaults 100, max 500. Show names are canonical expressions (48 chars, numbered duplicates); sort by expression. avg/mean(x, n) = sma(x, n); sum(condition, n) = count(condition, n); if(c, a, b) = c ? a : b. x[n] is n bars ago, never x@n or lag(); x@1h reads an equal/larger interval. Quote: from "IBM" show close, close[1] as prior Rank: include type == "common" where rank(roc(close, 20) by sector) == 1 show sector, industry, market_cap, shares_outstanding, pe, ps, pb, percentile(roc(close, 20)) as pct sort pct desc Labels: type includes "common", "etf", "adr"; sector/industry/name are labels; futures category = sector (Metals); name never groups. industry_group/sub_industry are unpopulated. Rank/percentile groups <20 are undecided; warnings count groups/symbols; all groups small fails; rank 1 is highest, percentile is 0-100. Premarket: on 5m premarket show 100 (close / close@daily - 1) as gap, volume@session as vol sort gap desc Afterhours: on 5m afterhours show 100 (close / close@regular - 1) as move, high@premarket as prehigh sort move desc Phases: 5m, 15m, 30m, 1h, 4h; on premarket/regular/afterhours defaults to 5m; 1d = daily, no daily phase or 1m. @session: phase volume/price so far; @premarket/@regular: that phase; close@daily: prior session's close before open, today's after; premarket gap = close / close@daily - 1; close@daily[1] is two sessions back. Notional = close volume. Bare vwap: cumulative ((high + low + close) / 3) volume / cumulative volume, reset each New York phase; intraday stocks only (on 5m), stored venue-subset volume, slightly different from consolidated VWAP. Insiders: where insiders(code = "p", relation = "officer", security = "common", plan = "none", window = 20) window/within/lookback = n reads n query bars; canonical window = n: condition = count(dataset, n) > 0; .count totals counts; total fields sum admitted values, e.g. insiders(window = 63).net. Newest fields read last(field, n); novelty/hourly and facts windows are errors. News: where news(topic = "earnings", window = 5) Facts: where facts(concept = "revenue", period = "ttm").yoy > 0.10 show facts(concept = "revenue").value as revenue .value is reported; .yoy is a ratio (0.10 = 10%); period "quarter" = "quarterly", "year"/"yearly" = "annual", "ttm" = trailing year. Filings: where filings(form = "13d", kind = "amendment", change = "added") show filings(form = "13d").holder as holder, filings(form = "13d").stake as stake sort stake desc Forms: 8-k, 10-k, 10-q, 20-f, 40-f, 6-k, nt 10-k, nt 10-q, 10-12b, s-1, s-3, 424b4, 424b5, 13d, 13g, sc to-t, sc to-i, sc to-c, sc 14d9. kind: original/amendment/preliminary; change: new/added/reduced/unchanged/exited/switched/unknown. 8-K items: filings(form = "8-k", item = "2.02"); count(filings(form = "13g"), 5) counts filings. Fields: count, prior, lag, lag_before, holder, stake (percent), stake_before, stake_change (points), shares. Filters include role, session, holder, text. Expressions: from "IBM" fn body(k) = abs(close[k] - open[k]) show (close > open ? body(0) : na) ?? 0 as body_size, sum(i in 0..4 : body(i)) as total_body Library: use "<id>" as lib; lib.f(x). Other symbol: close of "SPY". Chart: from "IBM" on 5m mark level close[1] label "Prior" plot ema(close, 20)@1h chart Plots/marks accept comma lists; plot x as name labels it. Both need chart (max five named symbols): newest 200 bars, overlays and optional PNGs. A line --- batches five independent queries in 8192 UTF-8 bytes. Stock all daily keeps active stocks (at least $20M of close × volume in total over the last 20 trading sessions (about $1M a day), or $1M on the newest sessio…
run_saved_query
ChatGPTRuns an owned saved query by UUID, optionally at a historical version (integer at least 1). Omitted version selects current text. Results use the same public contract as run_query, including run_id, status, data_status, counts, warnings and undecided symbol/reason pairs. A result with a problem or diagnostics did not run as written: correct the query from them and run it again. Charts use detail:full by default with the newest 200 available bars, aligned plots and marks. Hosts that render Monk's view receive detail:compact with the last 20 bars and a summary, with the full chart in the view. MCP also attaches PNGs when available. chart full is equivalent to chart; query.saved reports the id and version of the text that ran. list_query_versions reads append-only history; update_query with old text and the current version as expected_version creates a new version restoring that text.
update_query
ChatGPTChanges only supplied name, text or description fields of an owned saved query. expected_version is the version the change is based on; a stale or missing value changes nothing and returns version-conflict with the current query. At least one field is required. Values unchanged after library pinning return the current version unchanged; a changed field appends a new version. Omitted fields stay unchanged; an empty description clears it. Supplying an older version's text creates a new version restoring it.