Skip to main content
Glama

Compare two stocks over the same dates

smartfin_compare_two_stocks
Read-onlyIdempotent

Compares two US-listed stocks or index ETFs on identical dates with the same money, on daily closing prices adjusted for stock splits with dividends reinvested, the way SmartFin's Compare Two Stocks page does. Returns, for each, the value of the starting amount and its total and yearly return, the worst fall with its dates and the months back to the high before it (or that it hasn't recovered), and, with monthly_amount, the whole holding (with_monthly: purchases made, money put in, value, and total return on the money put in) with that amount added once for each 1st of a month after the start date and on or before the end date, on the trading day nearest that 1st. Use when someone asks how two stocks or funds did against each other, e.g. "apple vs microsoft stock over 10 years" or "voo vs qqq since 2015". Do not use for one stock (use smartfin_calculate_investment_return), for ways of buying one stock (use smartfin_compare_investment_strategies), for future returns, or to say which to buy: it states both figures and never picks one. Limits: today's S&P 500 companies and major index ETFs only, prices in US dollars; both start on the same trading day, and when one stock's history starts later, both start then and the summary says so.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountNoStarting amount invested once in each, in US dollars. Default 1000
end_dateNoEnd date, YYYY-MM-DD; a weekend or holiday uses the nearest trading day. Omit for the latest close
start_dateNoStart date, YYYY-MM-DD; a weekend or holiday uses the nearest trading day (the earlier on a tie). Omit for 10 years before the latest close
first_tickerYesStock 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.
second_tickerYesStock 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.
monthly_amountNoOptional amount added to each every month after the start, in US dollars. Default 0

Output Schema

TableJSON 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.8/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnly, idempotent, non-destructive, closed-world), and the description goes well beyond them: it discloses the exact computation basis, that both series start on the same trading day with later-start tickers truncating both, and that the summary flags this. It also clarifies the tool never picks a winner, which is a genuine behavioral constraint.

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 purpose, then usage, then limits, and essentially every clause carries information. It is a very long run-on sentence, which slightly hurts scannability, but there is little filler to cut.

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 six parameters, a complex return shape, and date-alignment edge cases, the description covers scope limits, alignment rules, monthly-contribution behavior, and the no-recommendation guarantee. With an output schema present, return formatting need not be re-explained, and nothing an agent needs to call it correctly is missing.

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 description coverage is 100%, so the baseline is 3; the description nevertheless adds real meaning beyond the schema by explaining the monthly_amount mechanics (added once per 1st of month after start, executed on the nearest trading day) and the shared-start-date alignment behavior, which the schema does not spell out.

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 a specific verb and resource (compares two US-listed stocks or index ETFs on identical dates) and pins down the methodology (split-adjusted closing prices, dividends reinvested). It explicitly names the siblings it is not (smartfin_calculate_investment_return, smartfin_compare_investment_strategies), so an agent can route without opening schemas.

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?

Gives concrete positive triggers ('apple vs microsoft stock over 10 years', 'voo vs qqq since 2015') and explicit exclusions with the correct alternative named for each (one stock, buying strategies, future returns, buy recommendations). Limits on coverage (S&P 500 + major ETFs only) are stated up front.

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