Skip to main content
Glama

One stock against the S&P 500 (SPY)

smartfin_analyze_stock
Read-onlyIdempotent

One US-listed stock or index ETF against SPY, a fund that tracks the S&P 500, on the same dates, from daily closing prices adjusted for stock splits with dividends reinvested, the way SmartFin's Stock Analysis page measures it. Returns, for the stock and for SPY: total return and yearly rate (CAGR) over the dates and over 1, 3 and 6 months, year to date, 1, 3, 5, 10 and 20 years and since both started, the first close both have (with the gap in percentage points); each full calendar year; every 1-, 3- and 5-year holding period on month-end closes (highest, lowest, median, share with a gain); full months (highest, lowest, share up, average up and down month, median in each calendar month); largest one-day and Monday-to-Friday weekly rise and fall, share of days up; yearly volatility (sample spread of daily returns x sqrt 252), volatility in each full year, downside deviation, the last 20 trading days' volatility against its median over 5 years, skew and excess kurtosis; falls from a closing high until it recovered, at the first close at or above it (deepest, the 5 deepest, longest recovery, average of those 10% or more, counts of 10, 20 and 30% or more, the distance below the highest close in the data, Ulcer Index); historical one-day Value at Risk 95% and 99% and Expected Shortfall 95%; Sharpe, Sortino, Calmar and Martin ratios with a fixed 5% risk-free rate, and the information ratio; beta, correlation, R-squared and tracking error against SPY, and the plain average monthly return in the months SPY rose and fell; and at the to_date close: the 20-, 50-, 100- and 200-day simple averages with the distance from each, the last 50- and 200-day crossing dates, days above the 200-day average in the last 252, the 52-week closing high and low, and the 14-day RSI (Wilder's smoothing). Use when someone asks how a stock has done against the S&P 500, or for one of these measures for a stock, e.g. "nvda vs s&p 500 over 10 years", "apple 200 day moving average", "ko sharpe ratio", "tsla 52 week high" or "msft rsi". Do not use for buy or sell signals, forecasts or recommendations: it states past figures only, and RSI, the averages and the crossing dates are measurements of past closes, not signals. For two stocks against each other use smartfin_compare_two_stocks; for every fall of a chosen size use smartfin_calculate_crash_recovery. Limits: today's S&P 500 companies and major index ETFs, prices in US dollars, daily closes; the days both the stock and SPY traded, so no comparison starts before SPY's first close (29 Jan 1993); 3 years by default, or the full history if shorter. A figure the dates can't give is null, with the reason in notes.

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": {
      "symbol": "<symbol>"
    },
    "name": "smartfin_analyze_stock"
  }
}

Input Schema

NameRequiredDescriptionDefault
amountNoAmount for the growth figures, in US dollars. Default 1000; every percentage and ratio is the same at any amount
periodNoYears back from the latest close (or to_date), or max for the first close both have. Default 3. Ignored when from_date is given
symbolYesStock or ETF symbol, not a company name: AAPL not Apple. Covers 508 symbols: the S&P 500 companies plus the index ETFs SPY, VOO, IVV, QQQ, DIA, IWM, VTI.
to_dateNoLast date, YYYY-MM-DD, with from_date. Omit for the latest close
from_dateNoFirst date, YYYY-MM-DD; a weekend or holiday uses the nearest trading day. Omit to use period

Output Schema

NameRequiredDescriptionDefault
citeYesHow to credit this result
dataYes
nextYesSuggested follow-up calls
linksYes
how_toYesSteps for the user to see or redo this on smartfin.fyi
sourceYes
summaryYesPlain-language result the assistant can quote

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior5/5

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

Beyond the annotations (which already declare readOnly/idempotent/non-destructive/closed-world), the description discloses data provenance (split-adjusted closes with dividends reinvested), the measurement convention ('the way SmartFin's Stock Analysis page measures it'), the universe and survivorship caveat ('today's S&P 500 companies'), date-alignment rules, the default window, and null-with-notes behavior for uncomputable figures.

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

Conciseness2/5

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

The core is a single run-on sentence of roughly 400+ words enumerating dozens of metrics, many of which duplicate the output schema. The guidance sentences that actually help selection (when to use, when not to, alternatives, limits) are pushed to the end, so the agent must wade through output detail before reaching routing information.

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 tool of this complexity, the definition covers invocation, scope, defaults, alignment rules and failure semantics, so an agent has enough to call it correctly. It is over-complete on return values that the output schema already supplies, and it omits the growth/amount behavior, which is the one remaining gap.

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 coverage is 100%, so symbol, period, from_date and to_date are already fully documented, and the description adds only the default-window and date-alignment context. The amount parameter and the growth figures it drives are never mentioned in the description, leaving that one parameter entirely to the schema; baseline 3 is appropriate.

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 definition precisely scopes the resource ('One US-listed stock or index ETF against SPY') and names the benchmark basis, and it explicitly separates itself from smartfin_compare_two_stocks and smartfin_calculate_crash_recovery. It never states the action as a verb (analyze/compare/measure) and the purpose is somewhat buried under a very long output enumeration, so it falls just short of a 5.

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?

It gives an explicit use trigger with concrete example queries ('nvda vs s&p 500 over 10 years', 'apple 200 day moving average', 'msft rsi'), an explicit exclusion ('Do not use for buy or sell signals, forecasts or recommendations'), and routes to two named alternatives for different needs. It also states scope limits: 508 symbols, USD, daily closes, SPY's 29 Jan 1993 start, and a 3-year default.

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