Skip to main content
Glama
Yahoo Finance MCP Server

Yahoo Finance MCP Server

yfinance_get_stock_info

Read-only

Retrieve stock price, market cap, valuation ratios, dividend yield, 52-week range, sector, industry, and company details by ticker, with optional field filtering and JSON or Markdown output.

Instructions

Get comprehensive information about a stock including price, market cap, ratios, and company details.

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'GOOGL') fields: Optional list of field names to include (case-insensitive partial matching). Available fields: name, price, currency, market_cap, pe_ratio, forward_pe, dividend_yield, 52_week_high, 52_week_low, avg_volume, sector, industry, description (default: None, returns all fields) response_format: Output format - 'json' for structured data, 'markdown' for human-readable (default: 'markdown')

Returns: Formatted string containing stock information including: - Current price and currency - Market capitalization - PE ratios (trailing and forward) - Dividend yield - 52-week high/low - Average volume - Sector and industry - Company description

Example: yfinance_get_stock_info("AAPL", "json") yfinance_get_stock_info("TSLA", ["price", "market_cap", "pe_ratio"], "markdown") yfinance_get_stock_info("MSFT", fields=["sector", "industry"])

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": {
      "ticker": "<ticker>"
    },
    "name": "yfinance_get_stock_info"
  }
}

Input Schema

NameRequiredDescriptionDefault
fieldsNo
tickerYes
response_formatNomarkdown

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds useful defaults ('markdown' output, all fields returned when fields=None) and the case-insensitive partial-matching rule for field names, but says nothing about data freshness (live vs delayed quotes), rate limiting, or failure behavior for an unknown ticker — all material for a network-backed quote tool.

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

Conciseness3/5

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

Args are well organized and front-loaded after a clear one-line purpose, but the 'Returns' section re-lists the same eight data points already named in the opening sentence and duplicates an output schema that exists, which is dead weight. The examples also show positional calls like yfinance_get_stock_info("AAPL", "json") where the schema's second property is fields, so the argument order in examples is slightly at odds with the documented signature.

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 three-parameter read-only lookup with a return schema present, the definition covers purpose, all parameter meanings, defaults, and output shape, so an agent has enough to invoke it correctly. The remaining gap is operational context — whether quotes are delayed, how missing fields behave for thinly traded symbols, and whether an unknown ticker raises or returns empty — none of which is stated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden and does: it documents ticker with concrete examples, explains that fields accepts an optional list with case-insensitive partial matching, enumerates every valid field name, and states the None default means all fields. It also explains both enum values of response_format ('json' structured vs 'markdown' human-readable) and their default, which the bare enum does not convey.

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 specific verb and resource ('Get comprehensive information about a stock') and enumerates the returned content (price, market cap, ratios, company details), which implicitly separates it from history, news, financials, and options siblings. It never explicitly names a sibling tool or a disambiguating condition, so an agent must infer the boundary from the field list rather than being told.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

Usage is only implied through the returned-field list and three example calls; there is no explicit 'use this when X, use that instead when Y' statement and no mention of when a ticker may be invalid or when to prefer a bulk-quote sibling like get_multiple_quotes. The agent can infer a single-symbol snapshot use case, but the routing logic is left to it.

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