Skip to main content
Glama

build_monthly_universe

Rank a universe of tickers by monthly dollar volume with trailing returns. Resolves either a named universe (SP500, TSX) or an explicit tickers override, bulk-fetches daily OHLCV over range, resamples each to monthly bars (open=first, high=max, low=min, close=last, volume=sum), and per ticker computes trailing returns over 1/3/6/12 periods plus the latest monthly dollar volume (close * volume). Tickers are ranked by latest dollar volume (descending) and the top top_n are returned. Tickers that fail to fetch or lack enough monthly history are skipped and noted in warnings. range is the lookback (5d,1mo,3mo,6mo,1y,2y,5y,max; default 2y); use a multi-year window so the 12-month horizon is well-defined. values holds range, as_of (latest monthly date, YYYY-MM-DD), count, and results — a ranked list of {ticker, dollar_volume, returns: {1m,3m,6m,12m}, rank} where any horizon longer than the available history is null. (paid: $0.0100/call)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rangeNo
top_nNo
tickersNo
resampleNo
universeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so thoroughly: it discloses the resampling aggregation (open=first, high=max, low=min, close=last, volume=sum), the skip behavior for failed/incomplete tickers, the ranking method, and the return structure. It even includes pricing.

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 a single dense paragraph that front-loads the core purpose and then systematically details method, parameters, and output. It is longer than minimal but every sentence contributes necessary context for a complex tool; no fluff.

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?

Given no output schema, the description explains the return object thoroughly (range, as_of, count, results with fields). It also covers the skip/warning behavior and range guidance. The only missing piece is the full semantics of the resample parameter and defaults for non-range parameters, but overall it is highly complete.

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 0%, so the description must explain all parameters. It covers range, universe, tickers, and top_n well, but does not explain the resample parameter's effect when set to 'Q' — it only states monthly resampling, which is incomplete given the schema allows 'M' or 'Q'. Defaults for top_n and universe are also omitted.

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+resource+outcome: 'Rank a universe of tickers by monthly dollar volume with trailing returns.' It clearly distinguishes itself from siblings like screen by focusing on monthly resampling and ranking, and details the exact output structure.

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?

The description implies usage by defining the available universe options (SP500, TSX, or explicit tickers) and gives an explicit practical guideline: use a multi-year window for the 12-month horizon. It does not explicitly name alternatives or when-not-to-use, but the context is clear.

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