Skip to main content
Glama
lkcair

yfinance-ai MCP server

by lkcair

get_historical_price_on_date

Read-onlyIdempotent

Retrieve a stock, ETF, or crypto historical price for a specific date (or nearest trading day) using its ticker and a YYYY-MM-DD date.

Instructions

Get historical price for a specific date.

Args: ticker: Stock ticker symbol date: Date in YYYY-MM-DD format (e.g., "2024-01-15")

Returns: Price on that date (or closest trading day)

Example: >>> await get_historical_price_on_date("AAPL", "2024-01-15")

Input Schema

NameRequiredDescriptionDefault
dateYes
tickerYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, and openWorld, so the safety profile is covered. The description adds genuinely new behavioral context beyond annotations: the fallback to 'closest trading day' when the date is not a trading day, which is exactly the kind of edge-case disclosure that matters here.

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?

Purpose is front-loaded in the first line, followed by clearly labeled Args/Returns/Example blocks. Every section earns its place, though the docstring-style scaffolding is slightly heavier than needed for two parameters.

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?

With annotations carrying the safety profile and an output schema handling return structure, the description supplies the remaining essentials: parameter formats, a usage example, and the non-trading-day fallback. Only the disambiguation from range-based price siblings is left unaddressed.

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 schema itself says nothing about the two parameters. The description fully compensates by defining ticker as a stock symbol and date as YYYY-MM-DD with a concrete example ('2024-01-15'), resolving the only real ambiguity (date format).

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?

States a specific verb and resource ('Get historical price') scoped to a single date, which is clear on its own. It does not differentiate itself from the closest sibling, get_historical_data/get_historical_comparison, which an agent would need to disambiguate between, so it stops 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 Guidelines3/5

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

The use case is implied by 'for a specific date', letting an agent infer single-date lookups. There is no explicit when-to-use, no exclusions, and no pointer to the range-based siblings (get_historical_data), leaving the agent to guess at the boundary.

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