Skip to main content
Glama
yfinance-ai MCP server

yfinance-ai MCP server

by lkcair

get_stock_price

Read-onlyIdempotent

Fetch the current stock price and key metrics for any ticker symbol, including market cap, P/E ratio, and more, to support quick stock analysis.

Instructions

Get current stock price and key metrics for a ticker symbol.

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'TSLA', 'SPY')

Returns: Formatted string with current price, market cap, P/E ratio, and other key metrics

Example: >>> await get_stock_price("AAPL") AAPL - Apple Inc. Current Price: $175.43 Market Cap: $2.75T ...

Input Schema

NameRequiredDescriptionDefault
tickerYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already indicate this is a safe, read-only, idempotent, non-destructive operation. The description adds useful context about the returned metrics and includes an example output, but it does not disclose limitations such as data freshness, market-hours constraints, or rate limits.

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?

The description is front-loaded with the main purpose and then uses structured Args, Returns, and Example sections. It is somewhat verbose in docstring style, but the example is useful and no sentence is clearly wasted.

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 simple one-parameter tool with rich annotations and an output schema, the description is nearly complete: it explains the parameter, indicates the return shape, and provides an example. It leaves out alternative-tool guidance, which is a minor gap.

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 0%, so the description must carry the parameter meaning. It does this by defining ticker as a stock ticker symbol and giving examples such as 'AAPL', 'TSLA', and 'SPY', which meaningfully compensates for the bare schema property.

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 states a clear verb and resource: getting current stock price and key metrics for a ticker symbol. It is specific enough for an agent to understand the operation, but it does not differentiate this tool from close siblings such as get_stock_quote or get_fast_info.

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

Usage Guidelines2/5

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

There is no explicit guidance on when to use this tool instead of alternatives like get_stock_quote, get_fast_info, or get_historical_data. The usage is implied by the purpose statement, but no when/when-not conditions or routing guidance are provided.

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