Skip to main content
Glama

Screener: search stocks by criteria

search_stocks
Read-onlyIdempotent

Screen companies by a filter DSL over the 82-metric catalog. Required: where={filter:{...}, sort_by?, sort_order?}. Filter supports leaves {metric, op, value, for_latest|for_consecutive|for_at_least?} and composites and/or/not. Operators: >, >=, <, <=, between. Temporal modifiers (mutex per leaf): for_latest N (latest N pass), for_consecutive N (any N adjacent pass), for_at_least N (>= N within lookback pass). Optional: as_of_date, lookback (1-120), include_quarterly, tickers (whitelist, <=100), exclude_tickers, usd_only, sectors (Pro+ — filter the universe to canonical sector buckets; names from list_screener_filters.sectors), include_metrics_using_filing_date_price (gates 13 valuation ratios), exclude_derivations, include_metrics (<=10 extra columns), group_by_ticker (default true), page, page_size (<=100; page*page_size <=500). Dynamic credit cost per request (89-1825). Pre-run list_screener_filters once to discover supported metric ids + operators. lookback is auto-clamped to your plan's history window so you are only billed for the portion you can access; when clamped, _warnings is populated. Companies outside your plan's coverage scope are also silently excluded; _warnings is populated when this happens. Pro+ results carry a per-row classification block (canonical sector(s) + source). POST /api/v1/screener/metrics; FINANCIAL_API_DOCUMENTATION.md. Requires the Pro plan or higher.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNo1-based page number (default 1). page × page_size ≤ 500.
whereYesFilter + sort, shaped {"filter": <tree>, "sort_by"?: <metric id or "ticker"/"period_end"/"filing_date"/"match_count">, "sort_order"?: "asc"|"desc"}. A filter tree is either a leaf {"metric": <id>, "op": ">"|">="|"<"|"<="|"between", "value": <number, or [lo, hi] for between>, plus one optional temporal modifier "for_latest"|"for_consecutive"|"for_at_least": N}, or a composite {"and": [<tree>, …]} / {"or": [<tree>, …]} / {"not": <tree>}. 1–10 leaves total, nesting depth ≤ 4. Metric ids come from list_screener_filters.
sectorsNoOptional universe pre-filter: keep only companies in these canonical sector buckets (11 + 'Other'; the exact names are in list_screener_filters.sectors). Pro+ only — sub-Pro callers passing this get 403.
tickersNoOptional whitelist restricting the search to these tickers (≤ 100).
lookbackNoHow many filings back the temporal modifiers look (1–120; default 1). Auto-clamped to your plan's history window.
usd_onlyNoWhen true, only return rows whose metric values are in USD.
page_sizeNoRows per page, 1–100 (default 50). page × page_size ≤ 500.
as_of_dateNoAs-of date "YYYY-MM-DD"; excludes filings filed after this date. Defaults to no cutoff.
exclude_tickersNoOptional tickers to exclude (≤ 100).
group_by_tickerNoWhen true (default), return one row per ticker; when false, one row per filing.
include_metricsNoOptional extra metric ids to return as columns alongside the filtered ones (≤ 10).
include_quarterlyNoWhen true, include quarterly filings (10-Q) as well as annual; default false (annual only).
exclude_derivationsNoOptional metric-derivation kinds to exclude, e.g. "as_reported", "composite".
include_metrics_using_filing_date_priceNoWhen false, reject filtering/sorting on the 13 price-sensitive valuation ratios; default true.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, so the safety profile is covered. The description adds genuinely useful behavioral context beyond that: dynamic credit cost per request (89-1825), auto-clamping of lookback with _warnings, silent exclusion of out-of-coverage companies with _warnings, and the Pro+ classification block. It does not describe the full response shape, but with no output schema and a complex tool, the cost and warning behaviors are the most decision-relevant traits and they are disclosed.

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?

The description is dense but well-organized: it front-loads the required 'where' shape, then operators, then temporal modifiers, then optional parameters, then cost and warnings. Every sentence earns its place, and the most critical operational facts (required field, pre-run companion, cost, clamping) are prominent. It is long, but the tool is genuinely complex with 14 parameters and a nested DSL, so the length is justified. It loses one point only because a few details (e.g., 'FINANCIAL_API_DOCUMENTATION.md' reference) are marginal for an agent deciding how to call the tool.

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

Completeness4/5

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

For a 14-parameter tool with nested objects, no output schema, and no enums, the description is unusually complete: it covers the required DSL, operator set, temporal modifier semantics, constraints (leaf count, depth, page limits, ticker limits), plan gating, cost range, and warning behavior. The main omissions are the exact response row shape and the full list of sortable keys, but the schema's where description covers sort_by options and the description points to list_screener_filters for metric discovery. Given the complexity, this is close to complete but not perfect.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3. The description adds meaning beyond the schema by explaining the required shape of 'where' in compact DSL form, clarifying that temporal modifiers are mutually exclusive per leaf, noting the leaf count and nesting depth limits, and explaining the effect of include_metrics_using_filing_date_price ('gates 13 valuation ratios'). It also adds the page*page_size <=500 constraint that is repeated in the schema but consolidated here. The only minor gap is that the description doesn't enumerate the sort_by options, but the schema's where description does.

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?

The description opens with a specific verb ('Screen companies') and a precise resource ('82-metric catalog'), and the title 'Screener: search stocks by criteria' matches. It clearly distinguishes this from the many get_* and list_* siblings by framing it as a filter-DSL screening tool, and it names the companion tool list_screener_filters for discovering metric ids. An agent can tell this is the cross-sectional screener, not a timeseries or statement retrieval tool.

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

Usage Guidelines5/5

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

The description explicitly says to 'Pre-run list_screener_filters once to discover supported metric ids + operators,' which is direct when-to-use guidance. It also states the Pro plan requirement and the Pro+ gating on sectors, and it explains when _warnings is populated (lookback clamping and coverage exclusions). The sibling list includes list_screener_filters, so the routing to that companion is explicit.

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.

Resources