Skip to main content
Glama

get_etf_holdings

Read-onlyIdempotent

List the constituents of an ETF.

Base mode (default): returns every holding with its weight % in the
index — {ticker, name, weight_pct}.

Top-performers mode: pass `sort_by` (one of '5d', 'month', 'ytd',
'year') and a `limit` > 0 to get the top N constituents by that
period's return. Each row carries weight_pct, current_price,
return_pct for the chosen period, and analyst_consensus.

Use the top-performers mode for questions like 'which stocks in XLK
rose most this week' without separately calling a screener.

Args:
    ticker: ETF ticker (e.g. 'SPY', 'QQQ').
    sort_by: '' for full list, or one of '5d', 'month', 'ytd', 'year'.
    limit: 0 to return all constituents; >0 (max 50) to return top N. A
        negative or non-numeric limit is REJECTED rather than treated as 0 —
        `limit` picks the mode here, so defaulting an unusable one would
        answer a ranked top-N request with the full unranked list.

Input Schema

NameRequiredDescriptionDefault
limitNo
tickerYes
sort_byNoOptional period to sort by, descending: '5d', 'month', 'ytd' or 'year'; when set, returns top performers instead of the full list.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / sort_by / description
      Previous value: -"Optional prices field to sort by descending (e.g. 'prices.5d.gain', 'prices.twoWeeks.gain', 'prices.month.gain'); when set, returns top performers instead of the full list."New value: +"Optional period to sort by, descending: '5d', 'month', 'ytd' or 'year'; when set, returns top performers instead of the full list."
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "title": "Result",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "get_etf_holdingsOutput",
      -  "type": "object"
      -}New value: +null
  3. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already establish the safe read-only profile, and the description adds genuine extra context: the returned field sets per mode ({ticker, name, weight_pct} vs weight_pct, current_price, return_pct, analyst_consensus) and the limit validation rule that negative/non-numeric values are rejected rather than coerced. Missing pieces like rate limits are minor for an idempotent read.

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?

Front-loads the mode distinction before the Args block, and each sentence carries information. The rationale paragraph justifying the negative-limit rejection is unusually verbose for an edge case, but it is the kind of detail that prevents a silent mis-call.

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 3-parameter read tool with no output schema, the description supplies the mode semantics, the per-mode return fields, and the boundary behavior of the only tricky parameter. Nothing an agent needs in order to invoke it correctly is left unstated.

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

Parameters5/5

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

With schema description coverage at only 33% and no enums declared in the schema, the description carries the load and does so thoroughly: it enumerates sort_by's valid values ('5d', 'month', 'ytd', 'year'), defines limit's 0-vs-positive semantics with a max of 50, and explains why negative limits are rejected. This is meaning well beyond what the schema provides.

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

Purpose4/5

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

States a concrete verb+resource ("List the constituents of an ETF") and spells out the two operating modes and their exact return shapes, so an agent knows precisely what it gets. It partially differentiates from siblings by noting it replaces a separate screener call, but never distinguishes itself from get_etf_top_stocks, which appears to overlap with the top-performers mode.

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 explicit mode-selection rules: default for the full holding list, and `sort_by` plus `limit`>0 for top-N by period, with a concrete motivating question ("which stocks in XLK rose most this week"). It even steers the agent away from a redundant screener call. It stops short of naming when to prefer the sibling get_etf_top_stocks or get_etf_exposures instead.

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