Skip to main content
Glama

TickerInside ETF Holdings

Stock comparison and weight in an ETF

compare_stocks
Read-onlyIdempotent

Use this when the user asks how two US stocks compare on size, valuation, returns, risk or correlation, or what weight and rank one stock has inside one named ETF, for example META in QQQ. For two stocks it returns market cap, P/E and dividend yield from market data, returns, volatility, worst fall, beta, the correlation of weekly returns over up to three years and the covered ETFs holding both. For a stock and an ETF it returns whether the ETF holds the stock, at what weight and rank among the shares it holds outright, with the date of the ETF's holdings; a derivative-based ETF's swaps, futures and options are in its profile (get_etf_holdings), not here. A stock is in the data with about two years of US prices, and sooner for a recent listing a covered ETF holds. Returns are past, not a forecast. Not for comparing two ETFs (compare_etfs), or a company's business or products.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "a": "<a>",
      "b": "<b>"
    },
    "name": "compare_stocks"
  }
}

Input Schema

NameRequiredDescriptionDefault
aYesA US stock ticker, for example NVDA. An ETF ticker also works on one side, for example QQQ.
bYesThe other ticker, for example AMD.

Output Schema

NameRequiredDescriptionDefault
pairNo
sourceNo
coveredNo
membershipNoFor a stock and an ETF.
weeks_usedNo
not_in_dataNo
prices_as_ofNo
correlation_3yNo
funds_holding_bothNo
funds_holding_both_countNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / membership / description
      Previous value: -"For a stock and a fund."New value: +"For a stock and an ETF."
  2. Changed3 schema fields changed
    • changedInput schema / properties / a / description
      Previous value: -"A US stock ticker, for example NVDA. An ETF ticker also works."New value: +"A US stock ticker, for example NVDA. An ETF ticker also works on one side, for example QQQ."
    • changedInput schema / properties / b / description
      Previous value: -"The other ticker."New value: +"The other ticker, for example AMD."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "patternProperties": {
      +    "^[A-Z0-9.\\-^=/ *&]{1,16}$": {
      +      "properties": {
      +        "beta": {
      +          "description": "Over three years.",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "dividend_yield_pct": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "expense_ratio_pct": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "kind": {
      +          "enum": [
      +            "stock",
      +            "fund"
      +          ],
      +          "type": "string"
      +        },
      +        "market_cap_bn": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "name": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "pe": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "return_1y_pct": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "return_3y_pct": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "volatility_pct": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "worst_fall_3y_pct": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        }
      +      },
      +      "required": [
      +        "kind"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "properties": {
      +    "correlation_3y": {
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "covered": {
      +      "type": "boolean"
      +    },
      +    "funds_holding_both": {
      +      "items": {
      +        "properties": {
      +          "fund": {
      +            "type": "string"
      +          },
      +          "holdings_as_of": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "weight_a_pct": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "weight_b_pct": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "fund"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "funds_holding_both_count": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "membership": {
      +      "description": "For a stock and a fund.",
      +      "properties": {
      +        "holdings_as_of": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "in_fund": {
      +          "type": "boolean"
      +        },
      +        "rank": {
      +          "type": [
      +            "integer",
      +            "null"
      +          ]
      +        },
      +        "weight_pct": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        }
      +      },
      +      "required": [
      +        "in_fund"
      +      ],
      +      "type": "object"
      +    },
      +    "not_in_data": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "pair": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "prices_as_of": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "source": {
      +      "properties": {
      +        "api_urls": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "license": {
      +          "type": "string"
      +        },
      +        "provider": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "provider",
      +        "license",
      +        "api_urls"
      +      ],
      +      "type": "object"
      +    },
      +    "weeks_used": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already establish read-only, idempotent, non-destructive behavior, and the description meaningfully adds on top: data coverage limits (roughly two years of US prices, earlier for recent listings covered by an ETF), the caveat that a derivative-based ETF's swaps/futures/options are not reflected here, and the explicit disclaimer that returns are historical, not forecasts.

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-loaded with the triggering condition, and every sentence carries distinct information (output contents for each mode, data coverage, exclusions). It is long and dense — the two output modes could be split more cleanly — but there is little wasted text.

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?

Despite a rich output schema and safe annotations, the description covers what matters an agent can't infer: which mode is triggered by which argument combination, data window limitations, the ETF-derivatives blind spot, and the sibling-tool boundary.

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 coverage is 100% and both params are already documented with examples, so the baseline is 3. The description adds genuine meaning about how the two parameters interact — two tickers yield a stock-vs-stock comparison, while one stock plus one ETF switches to a holdings/weight/rank query — which the schema alone does not convey.

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?

States specific verbs and resources — comparing two US stocks on size, valuation, returns, risk, correlation, and checking a stock's weight/rank in a named ETF — with a concrete example (META in QQQ). It explicitly distinguishes itself from compare_etfs and get_etf_holdings, so an agent can route correctly 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 Guidelines5/5

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

Opens with explicit when-to-use ('when the user asks how two US stocks compare...'), gives when-not ('Not for comparing two ETFs (compare_etfs), or a company's business or products'), and names two alternative tools with the conditions that select them.

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