Skip to main content
Glama

Unified Screener (Universe × Fundamental × Technical)

screen_unified
Read-only

EXECUTE a unified screen = universe ∩ fundamental ∩ technical ∩ options (any leg optional; each grammar resolved server-side — key or plain English). Returns {universe, count, sort, executed_criteria (the resolved request that ran — save/re-run it verbatim), results:[{head_listing_id, ticker, name, score, matched_legs, matched:{ta, fundamental:{:{value, basis, window?, series?, periods?}}}, context}], notes}. Evidence keys == the leg name you sent (TA→matched.ta, fundamentals→matched.fundamental, NOT technical/financial); matched_legs lists which leg(s) a row passed. A thin intersection adds partial:true + per-leg near-misses — never present a partial/one-leg row as a full match; read notes (names the tighter leg + how to broaden). Time windows are PER-LEG: TA 'within last N bars' = top-level window_bars; a fundamental trend's span = that condition's N. Options leg is US-optionable only (~557 → US-capped); sort='options' ranks by it; an options-vs-price divergence = just send the phrase in options. FAILS LOUD: an unsupported pattern/operand/concept returns a 400, so count:0 with NO error = a VALID query that matched zero now (loosen / widen window_bars, don't say 'can't do X'); notes may say 'insufficient history' (not a no-match) or which basis was screened. Over-fetches a ~4× buffer (cap 100) so 'show me more' is served from these rows — don't re-call.

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": "screen_unified"
  }
}

Input Schema

NameRequiredDescriptionDefault
taNoThe TECHNICAL leg — a THEN chain of steps (usually ONE). Each signal = `pattern` (SHAPE) + operands `a`/`b` (LINES), key or plain English, server-resolved. e.g. golden cross + volume spike → [{anchor:[{pattern:'crossover_up',a:'ema50',b:'ema200'}],quals:[{any:[{pattern:'volume_spike'}]}]}]. 'within the last N bars' = each signal's own `window_bars` (else the screen-level default); mix timeframes by setting a qualifier's own `timeframe` (1/2/3). Omit for a fundamentals-only screen.
gicsNoOPTIONAL universe SCOPE — industry/theme concept(s), CSV of ATOMIC concepts (decompose 'banks and insurance' → 'banks,insurance'). Each = English ('banks','semiconductors','AI') or a GICS code prefix ('45'=IT sector, '352010'=biotech industry; shorter=broader); the server picks the axis (industry→GICS, megatrend→THEME). Omit = all sectors.
modeNoWhat to do with the formula. 'run' (default) = screen and return the stocks. 'check' = NO scan, no market data: resolve every field exactly as a run does and validate the formula (rules only, fast) → {ok, executed_criteria, snaps/notes}, or the same needs_rewrite answer (code, path, error, _guide, nearest) when it cannot run — use it to try a formula or a choice BEFORE you offer it. 'count' = 'check' + how many stocks match (exact up to 500, `capped` above) — use it when only how many is needed. No rows in check/count; count_total is for 'run' only.
sizeNoOPTIONAL market-cap size tier(s), OR'd — 'large'|'mid'|'small'|'micro'. RELATIVE per-market MSCI tiers ('small' = small FOR ITS market, not in USD; no separate 'mega'). For an ABSOLUTE USD size / 'under $X' use min/max_market_cap_usd instead. Omit = all sizes.
sortNoRank key: 'ta' (default, TA chain score) · 'options' (use when `options` present) · 'mcap' · a TA-context oscillator ('rsi'/'adx' — 'most overbought'→'rsi') · or any fundamental metric key in the results (pe/roe/…).
limitNoHow many stocks to SHOW (default 10). Over-fetches a ~4× buffer (capped 100) so 'show me a few more' is served from THIS result — don't re-screen; re-screen only to exceed the buffer.
themeNoADVANCED raw-passthrough — megatrend THEME node_id(s), OR'd (core member of ANY). Normally OMIT: name the theme in `gics` ('AI') and the server routes it. Use only with a known node_id.
countryNoOPTIONAL operating-country scope — one or MORE ISO-2 codes, OR'd (a stock matches if in ANY of them). e.g. ['US'] · ['CN','US'] for China+US · ['TH','SG','MY']. Omit = all countries.
optionsNoThe OPTIONS leg — an options-behaviour term, key or plain English ('fear_building','iv_cheap','the crowd getting brave'), server-resolved. Intersects the ~557 US-optionable names showing it; an options-vs-price DIVERGENCE also goes here (the server expands it). US-optionable only. Omit for a non-options screen.
criteriaNoA WHOLE formula in the saved shape — the `executed_criteria` a screen_unified call returned, or the user's saved formula ({universe:{include:[{country,gics,size,theme,asset_type,mcap_min,mcap_max}], exclude:[…]}, ta, fundamental:[{concept,pattern,params}], options:{pattern,horizon}, timeframe, window_bars, dividend}). To change a formula you got back, send it here WITH YOUR CHANGE APPLIED — resolved keys stay as they are, plain-English fields inside are resolved as usual. Works with every `mode`. Do not also send the separate formula fields (fundamental, ta, options, gics, country, …) — one or the other; sort / limit / count_total / mode may go with it.
timeframeNoChart for the TA leg: 1=daily (default) · 2=weekly · 3=monthly. TA operand periods & for_bars are counted in BARS of this timeframe.
asset_typeNoOPTIONAL asset type(s), OR'd: 'Common Stock','ETF','Crypto','Currency','Commodity','Bond','Index','Fund','ADR','REIT'. Crypto≠Currency (forex); gold/silver=Commodity. Omit = all (a company screen usually wants 'Common Stock').
count_totalNoSet true ONLY when the user asks HOW MANY match ('how many stocks…', 'is it more than 500?'): returns the exact `total` up to 500, else `total_over: 500`. Slower (runs every leg in full) — omit for a normal screen.
fundamentalNoThe FUNDAMENTAL leg — AND-ed conditions (each = a METRIC `concept` + a SHAPE `pattern` + its value; key or plain English, server-resolved). e.g. roe>20% & 3y revenue growth → [{concept:'roe',pattern:'above',threshold:0.20},{concept:'revenue',pattern:'consecutive_growth',N:3}]. 🔴 A fundamental trend's TIME SPAN goes in that condition's `N` (periods of its `basis`, annual by default; set basis only for quarterly/TTM) — SEPARATE from the TA leg's window_bars. Omit for a TA-only screen.
window_barsNoTA-leg LOOKBACK in bars of `timeframe` — how far back a signal may have fired / the span a THEN-chain completes within ('…within the last N days'; 'divergence within 50 days' → 50). Whole `ta` leg; omit → default 30 × number of ta steps. SEPARATE from a fundamental trend's `N`.
exclude_gicsNoOPTIONAL — EXCLUDE industry/theme CONCEPT(s), CSV, codes or plain English ('banks','AI'); server-resolved & routed same as `gics`. Applies to EVERY leg ('high-yield but NOT banks' = fundamental dividend_yield + exclude_gics='banks'). `gics` INCLUDES; this EXCLUDES.
exclude_themeNoADVANCED raw-passthrough — EXCLUDE megatrend THEME node_id(s). Normally just name the theme to exclude in `exclude_gics` ('not AI'); the server routes it. Universe-level negation across every leg.
exclude_countryNoOPTIONAL — EXCLUDE operating-country(ies), ISO-2. 'global ex-US' = exclude_country=['US']. Universe-level, applies to every leg.
options_horizonNoOptions horizon: 'long' (default, positioning/conviction) or 'short' (gamma/near-term). Only meaningful with `options`.
dividend_min_cagrNoOPTIONAL dividend gate — 5-year dividend CAGR ≥ this % (5 = ≥5%/yr). Needs a fundamental/ta/options base leg too.
max_market_cap_usdNoOPTIONAL ABSOLUTE max market cap USD (2000000000 = under $2bn). Pair with min for a band.
min_market_cap_usdNoOPTIONAL ABSOLUTE min market cap USD (50000000000 = $50bn). Use this (not `size`) for a USD floor / 'under $X' band.
dividend_min_streak_yearsNoOPTIONAL dividend gate — keep stocks with a no-cut dividend streak ≥ N years (reliability streak in a 10-year window, capped at 10; NOT the full age). A membership gate — combine with a fundamental/ta/options base leg (pure dividend screen → screen_dividends).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With only readOnlyHint=true available, the description carries the disclosure load and does it well: it discloses the return envelope, that matched_legs/partial:true signals a thin intersection, and warns never to present a partial row as a full match. It also explains failure semantics (400 on unsupported patterns vs count:0 meaning a valid zero-match), the US-only ~557 cap on the options leg, per-leg time windows, and the over-fetch/cap-100 buffer — behavior an agent could not infer from readOnlyHint.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Content is dense but nearly every sentence carries operational weight, and the core purpose plus the intersection semantics are front-loaded. It is a single unbroken paragraph of heavy-caps text, which hurts scannability for a tool this complex, but there is little outright filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 23-parameter composite screener with no output schema, the description fills the gap by describing the response shape (results, matched, matched_legs, notes) and the partial-match behavior. Combined with the richly documented schema, an agent has enough to call it and interpret the result correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and the params are exhaustively documented, so the baseline is 3. The description reinforces the key cross-parameter distinction (TA top-level window_bars vs a fundamental condition's N, per-leg time windows), but that distinction is also already stated in the schema, so it adds little new meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and resource — 'EXECUTE a unified screen = universe ∩ fundamental ∩ technical ∩ options' — which names the exact intersection semantics that distinguish it from screen_stocks and screen_dividends. An agent can tell this is the multi-leg composite screener without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear operative context: each leg is optional, a fundamentals-only or TA-only screen is legitimate, and 'show me more' should be served from the ~4× over-fetch buffer rather than a re-call. It does not explicitly name when to prefer a sibling like screen_dividends or options_scan instead, so routing to alternatives is left implicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.