Skip to main content
Glama
Yahoo Finance MCP Server

Yahoo Finance MCP Server

compare_stocks

Read-onlyIdempotent

Compare 2–10 stocks side by side across price, market cap, P/E, EPS, dividend yield, 52-week range, and performance, with brief insights to support peer or relative analysis.

Instructions

Side-by-side comparison of 2-10 stocks across key metrics (price, market cap, P/E, EPS, dividend yield, 52-week range, and period performance) with brief auto-generated insights.

Use for "which is better, X or Y", peer/relative comparison, or screening a small set. For a deep dive on a single name use get_stock_quote or get_company_info.

Pass 2-10 tickers in the tickers list. Returns a Markdown comparison table by default, or JSON when response_format='json'. A ticker that fails to resolve is reported per-symbol rather than failing the whole call.

Input Schema

NameRequiredDescriptionDefault
tickersYesList of 2-10 stock ticker symbols to compare (e.g., ['AAPL', 'MSFT', 'GOOGL'])
response_formatNoOutput format: 'markdown' for human-readable or 'json' for machine-readablemarkdown

Output Schema

NameRequiredDescriptionDefault
messageNoSet instead of data when there is nothing to return for this request (for example, no dividends on record).
tickersNo
comparisonNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.6.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, openWorld, and non-destructive, so the safety profile is covered. The description adds real value beyond that: default return is a Markdown table, JSON is opt-in via response_format, and per-symbol resolution failures are reported individually rather than aborting the call — an unusual and important behavioral trait. It stops short of noting rate limits, latency, or whether the 'insights' are always present.

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?

Three short blocks in a deliberate order: what it does, when to use it versus alternatives, then invocation specifics and failure semantics. No filler sentences and no repetition of the metric list.

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 read-only comparison tool with an output schema and full parameter documentation, nothing an agent needs is missing: cost of calling is low, output format is selectable, and partial-failure behavior is disclosed — the one behavior an agent could otherwise guess wrong about.

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 description coverage is 100%, so both parameters are already documented, including the 2-10 min/max bounds and the markdown/json enum default. The description restates the ticker range and the json escape hatch without adding syntax, delimiter, or exchange-suffix guidance, so it neither compensates for nor extends the schema.

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 action (side-by-side comparison), the resource (2-10 stocks), and enumerates the exact metrics compared plus the auto-generated insights. It also explicitly distinguishes itself from single-name siblings (get_stock_quote, get_company_info), 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?

Gives concrete usage triggers ('which is better, X or Y', peer/relative comparison, screening a small set) and names the alternatives for the single-name deep-dive case. The only soft spot is that 'screening a small set' borders on the sibling screen_stocks, but the 'small set' qualifier implies the boundary.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.