yfinance_get_options_chain
Retrieve stock options chain data, including calls, puts, strikes, expirations, volume, open interest, and implied volatility. Filter by days to expiration or target date and summarize activity.
Instructions
Get options chain data for a stock. Returns call options near current price for the nearest expiration by default.
Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'GOOGL') expiration_date: Optional expiration date in 'YYYY-MM-DD' format (default: nearest) dte: Optional days to expiration - USE THIS for time-based queries: - 7 for "weekly options" - 30 for "monthly options" - 90 for "quarterly options" - 365 for "LEAPS" or "long-term options" MUTUALLY EXCLUSIVE with target_date - cannot use both (default: None, uses nearest expiration) target_date: Optional target date in 'YYYY-MM-DD' format to find closest expiration(s). USE THIS when query mentions a specific date like "around Dec 15" or "near January" MUTUALLY EXCLUSIVE with dte - cannot use both (default: None) limit: Number of closest expirations to return (works with dte or target_date). - 1 = single closest expiration (default) - 2 = two closest (one before, one after if possible) - 3+ = N closest expirations around the target EFFICIENCY: Always use limit parameter to get multiple expirations in ONE call, rather than making multiple separate calls with different dte values. (default: 1) option_type: 'calls', 'puts', or 'both' - Use 'both' when query mentions "what's available" or exploratory requests - Default: 'calls' strikes_near_price: Number of strikes above/below current price, or None for all (default: 10) in_the_money: True for ITM, False for OTM, None for both (default: None) min_volume: Minimum volume filter - ONLY use if query mentions "liquid" or "active" (default: None) min_open_interest: Minimum open interest filter - ONLY use if query mentions "liquid" or "active" (default: None) strike_min: Minimum strike price (default: None) strike_max: Maximum strike price (default: None) fields: Which fields/data to return. Special values: - ["expiration_dates"] or ["expirations"] = return only dates without contract data - None (default) = return full contract data Use for queries like "what expiration dates does [ticker] have?" summary: If True, return aggregate statistics instead of individual contracts. Returns: total volume, open interest, strike ranges, avg IV, most active strikes, put/call ratios. Use this for queries asking for "summary", "activity", "overview", or "sentiment" - NOT for queries asking for specific contracts/strikes. Works seamlessly with limit parameter to analyze multiple expirations. (default: False) response_format: 'json' or 'markdown' (default: 'markdown')
Query interpretation: - "weekly options" → dte=7 - "monthly options" → dte=30 - "around Dec 15" or "near December 20" → target_date="2024-12-15", target_date="2024-12-20" - "3 expirations around..." → limit=3 with dte or target_date - For multiple time periods (weekly, monthly, quarterly): Use dte with limit, NOT separate calls Example: "compare weekly, monthly, quarterly" → dte=30, limit=3 (gets ~weekly, ~monthly, ~next monthly in ONE call) - "what options are available" → option_type="both" - "what expiration dates" or "what dates are available" → fields=["expiration_dates"] - "activity summary", "options activity", "market sentiment", or any query with "summary" → summary=True - "liquid/active options" (without "summary") → add min_volume and min_open_interest (NOT summary=True) - Don't add filters unless specifically requested
Returns: Options chain data with contract details, prices, volume, open interest, and implied volatility. If fields=["expiration_dates"], returns only the list of expiration dates. If summary=True, returns aggregate statistics for market analysis. If limit > 1, returns data for multiple expirations.
Examples: yfinance_get_options_chain("SPY", fields=["expiration_dates"]) # Just get available expiration dates yfinance_get_options_chain("SPY", dte=7) # Weekly options (closest to 7 days) yfinance_get_options_chain("SPY", dte=7, summary=True) # Weekly options activity summary yfinance_get_options_chain("SPY", dte=30, limit=3) # Get 3 expirations around 30 days (detailed contracts) yfinance_get_options_chain("TSLA", dte=30, limit=3, summary=True, option_type="both") # Compare activity across 3 expirations yfinance_get_options_chain("AAPL", dte=30, limit=3, fields=["expiration_dates"]) # Get 3 expiration dates around 30 days yfinance_get_options_chain("AAPL", target_date="2024-12-15", limit=2) # 2 closest expirations to Dec 15 (detailed) yfinance_get_options_chain("TSLA", dte=7, min_volume=1000) # Liquid weekly options
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_options_chain"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dte | No | ||
| limit | No | ||
| fields | No | ||
| ticker | Yes | ||
| summary | No | ||
| min_volume | No | ||
| strike_max | No | ||
| strike_min | No | ||
| option_type | No | calls | |
| target_date | No | ||
| in_the_money | No | ||
| expiration_date | No | ||
| response_format | No | markdown | |
| min_open_interest | No | ||
| strikes_near_price | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |