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

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
tickerYes
sort_byNoOptional 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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
  2. First observed

TDQS

A4.3/5.0
Behavior5/5

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

With annotations already marking the tool read-only and idempotent, the description adds significant behavioral detail: the default-vs-top mode switch selected by `limit`/`sort_by`, and the explicit note that a negative or non-numeric `limit` is REJECTED rather than coerced to 0. This gives the agent an actionable model of how the tool behaves.

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

Conciseness5/5

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

The description is front-loaded with the core purpose and then organizes modes into compact labeled paragraphs. Every sentence adds necessary information about selection, output fields, or error handling, with no wasted words.

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?

With no output schema, the description compensates by listing the fields returned in each mode and covering the key error behavior. It is slightly incomplete around ambiguous combinations such as setting `sort_by` without a positive `limit`, and the sort_by value discrepancy leaves some residual uncertainty.

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?

The description compensates for the sparse schema coverage by explaining `ticker`, the allowed `sort_by` values, and the meaning of `limit`, including the max of 50. However, it contradicts the schema's `sort_by` examples ('5d' vs 'prices.5d.gain'), which could confuse an agent about which values to pass.

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?

The description opens with a clear verb and resource: 'List the constituents of an ETF,' and then details two modes, so an agent knows what the tool returns. It does not explicitly differentiate this from adjacent ETF tools such as get_etf_top_stocks or get_etf_exposures, leaving the agent to infer boundaries.

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 gives an explicit use case: 'Use the top-performers mode for questions like "which stocks in XLK rose most this week" without separately calling a screener.' This states when to use the mode, but it does not enumerate alternatives or explain when the base mode should not be chosen.

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