Defeatbeta Api

by defeat-beta

689 stars
708 downloads
Not rated
GitHub

About

An open-source alternative to Yahoo Finance's market data APIs with higher reliability.

Details

Author
defeat-beta
GitHub stars
689
Downloads
708
Categories
Finance, Developer Tools, API

- Exposes financial data as MCP tools
- Context construction and windowing for LLMs
- Output shaping for structured analysis
- Isolated Python virtual environment
- Pre-warm cache for fast initialization
- Supports multiple MCP clients

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Defeatbeta Api
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install using uvx (recommended) or the one-line install script, then configure the server in your MCP client (Claude Desktop, Manus, or Cherry Studio) by adding a JSON entry with command: "uvx" and args pointing to the GitHub repository subdirectory. Optionally set the DEFEATBETA_GATEWAY environment variable for an HTTP proxy. The server runs in stdio mode and communicates via JSON-RPC.

get_latest_data_update_date

Get the latest data update date of the defeatbeta dataset. This is the most recent date for which historical price data is available in the defeatbeta dataset (typically the last date when the entire dataset was refreshed with new trading data). This is NOT the real-time server date, and NOT necessarily today's date. All available stock prices are up to and including trading days on or before this data date. Use this date as the reference point ("today" in data terms) when handling relative time queries such as "last 10 days", "past month", "year-to-date", etc. Returns: A dictionary containing the latest data date in YYYY-MM-DD format.

get_stock_profile

Retrieve the basic company profile information for a given stock symbol. Args: symbol (str): The stock ticker symbol, e.g., "TSLA" or "tsla" (will be automatically converted to uppercase). Returns: dict: A dictionary containing the company's basic profile information. Common keys include: - symbol: Stock ticker symbol - address: Company headquarters address - city: City where the company is headquartered - country: Country of headquarters - phone: Company phone number - zip: Postal/ZIP code - industry: Industry classification - sector: Sector classification - long_business_summary: Detailed business description/summary - full_time_employees: Number of full-time employees - web_site: Official company website URL - report_date: Date of the data report or last update Example (for TSLA): { 'symbol': 'TSLA', 'address': '1 Tesla Road', 'city': 'Austin', 'country': 'United States', 'phone': '512 516 8177', 'zip': '78725', 'industry': 'Auto Manufacturers', 'sector': 'Consumer Cyclical', 'long_business_summary': 'Tesla, Inc. designs, develops, manufactures, l...', 'full_time_employees': 125665, 'web_site': 'https://www.tesla.com', 'report_date': '2025-04-12' } Notes: - The underlying data is returned as a single-row pandas DataFrame from the ticker details. - The function converts the first row to a dictionary for easier handling. - If no data is available (empty DataFrame), an empty dictionary is returned.

get_stock_price

Retrieve historical stock price data for the specified symbol and optional date range. Args: symbol: Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). start_date: Optional start date in YYYY-MM-DD format (e.g., "2015-12-30"). If None, data starts from the earliest available date. end_date: Optional end date in YYYY-MM-DD format (e.g., "2025-12-24"). If None, data goes up to the most recent trading day. Returns: A dictionary with: - symbol - date_range (actual dates covered) - rows_returned (number of rows in this response) - truncated (True if data was limited by MAX_ROWS) - latest_close - data (list of daily records) Important note on data limits: To prevent responses from becoming too large for the language model to process (which can cause errors or token limit exceeded issues), this tool caps the maximum number of rows returned at 1000 (MAX_ROWS = 1000). When the requested range contains more than 1000 rows, only the most recent 1000 trading days are returned, and "truncated": true is set. If you need data further back: - Make multiple calls with different (earlier) date ranges - Or call with a narrower start_date/end_date to stay under the limit Note: Unless explicitly stated otherwise, this tool operates on data that is current up to the latest data update date returned by `get_latest_data_update_date`. Use that date as the authoritative reference point ("today") when interpreting date ranges or relative time expressions.

get_stock_officers

Retrieve key executive officers and senior management information for a given publicly traded company. This tool returns a list of company officers, including executives and senior leaders, along with their titles, age, compensation, and equity-related information when available. Args: symbol (str): Stock ticker symbol (e.g., "TSLA", "AAPL"). Case-insensitive and will be converted to uppercase. Returns: dict: A dictionary with the following structure: { "symbol": "TSLA", "rows_returned": 10, "officers": [ { "name": "Mr. Elon R. Musk", "title": "Co-Founder, Technoking of Tesla, CEO & Director", "age": 53, "born": 1971, "pay": null, "exercised": 0, "unexercised": 0 }, ... ] } Notes: - Data is sourced from the defeatbeta dataset via `ticker.officers()`. - Missing or unavailable numeric values are returned as `null`. - Equity-related fields: - exercised: Number of stock options exercised - unexercised: Number of stock options unexercised - The list may include both executive officers and senior managers, depending on company disclosure. - If no officer data is available, an empty list is returned.

get_stock_earning_call_transcripts_list

Retrieve a list of available earnings call transcripts for a company. This tool returns metadata for all available earnings call transcripts, including fiscal year, fiscal quarter, and report date. It does NOT return the full transcript content. Use this tool to: - Discover which earnings calls are available - Identify the most recent fiscal quarter - Select a specific period for detailed transcript retrieval Args: symbol (str): Stock ticker symbol (e.g., "TSLA", "AAPL"). Case-insensitive and will be converted to uppercase. Returns: dict: A dictionary with the following structure: { "symbol": "TSLA", "rows_returned": 25, "transcripts": [ { "fiscal_year": 2024, "fiscal_quarter": 4, "report_date": "2025-01-29" }, ... ] } Important notes on fiscal periods: - "fiscal_year" and "fiscal_quarter" follow the company's fiscal calendar, which may differ from the calendar year and calendar quarters. - Fiscal periods are determined by the company's accounting calendar, not by the current date. Example: A company may report earnings in December 2025 that are labeled as: fiscal_year = 2026 fiscal_quarter = 2 This means the earnings belong to the company's FY 2026 Q2, even though the calendar year is still 2025. Notes: - This tool provides metadata only. - Use `get_earning_call_transcript` to retrieve the full transcript for a specific fiscal year and quarter.

get_stock_earning_call_transcript

Retrieve the full earnings call transcript for a specific fiscal period. This tool returns the complete transcript content for a given fiscal year and quarter, including speaker attribution and paragraph order. Args: symbol (str): Stock ticker symbol (e.g., "TSLA"). fiscal_year (int): Fiscal year (e.g., 2024). fiscal_quarter (int): Fiscal quarter (1–4). Returns: dict: A dictionary with the following structure: { "symbol": "TSLA", "fiscal_year": 2024, "fiscal_quarter": 4, "paragraphs": [ { "paragraph_number": 1, "speaker": "Operator", "content": "Good afternoon, everyone and welcome to..." }, ... ] } Important notes on fiscal periods: - "fiscal_year" and "fiscal_quarter" follow the company's fiscal calendar, which may differ from the calendar year and calendar quarters. - Fiscal periods are determined by the company's accounting calendar, not by the current date. Example: A company may report earnings in December 2025 that are labeled as: fiscal_year = 2026 fiscal_quarter = 2 This means the earnings belong to the company's FY 2026 Q2, even though the calendar year is still 2025. Notes: - Transcript content can be large and may consume many tokens. - Intended for summarization, Q&A, or qualitative analysis of management commentary.

get_stock_news

Retrieve historical news data for the specified symbol and optional date range, including full content. Args: symbol (str): Stock ticker symbol (e.g., "AMD", "AAPL", "TSLA"). Case-insensitive; will be converted to uppercase. start_date (str, optional): Filter news on or after this date (YYYY-MM-DD). end_date (str, optional): Filter news on or before this date (YYYY-MM-DD). max_rows (int, optional): Maximum number of news items to return (default 50). Important note on data limits: To prevent responses from becoming too large for the language model to process (which can cause errors or token limit exceeded issues), this tool limits the maximum number of news items returned using the `max_rows` parameter (default: 50). When the number of news articles matching the requested date range exceeds `max_rows`, only the most recent news items are returned, and "truncated": true is set in the response. If you need more or older news: - Increase the `max_rows` value (with caution) - Or make multiple calls with narrower date ranges (e.g., split by week or month) Note: Unless explicitly stated otherwise, this tool operates on data that is current up to the latest data update date returned by `get_latest_data_update_date`. Use that date as the authoritative reference point ("today") when interpreting date ranges or relative time expressions. Returns: dict: { "symbol": str, "date_range": str, # actual date range covered "rows_returned": int, "truncated": bool, "news": [ { "uuid": str, "report_date": str, "title": str, "publisher": str, "type": str, "link": str, "related_symbols": list[str], "paragraphs": [ { "paragraph_number": int, "paragraph": str, "highlight": str # optional }, ... ] }, ... ] }

get_stock_quarterly_income_statement

Retrieve the quarterly income statement for a given stock symbol. This tool returns income statement data structured by quarter, with each quarter represented as a record containing standardized income statement line items. Returns: dict: { "currency": "USD", "period_type": "quarterly", "periods": list[str], # e.g. ["2024-12-31", "2024-09-30", ...] "rows_returned": int, # number of periods "statement": [ { "period": str, # quarter end date "items": { "<breakdown_name>": float | None, ... } }, ... ] }

get_stock_annual_income_statement

Retrieve the annual income statement for a given stock symbol. This tool returns income statement data structured by year, with each year represented as a record containing standardized income statement line items. Returns: dict: { "currency": "USD", "period_type": "annual", "periods": list[str], # e.g. ["2024-12-31", "2023-12-31", ...] "rows_returned": int, # number of periods "statement": [ { "period": str, # year-end date "items": { "<breakdown_name>": float | None, ... } }, ... ] }

get_stock_quarterly_balance_sheet

Retrieve the quarterly balance sheet for a given stock symbol. This tool returns balance sheet data structured by quarter, with each quarter represented as a record containing standardized balance sheet line items. Returns: dict: { "currency": "USD", "period_type": "quarterly", "periods": list[str], # e.g. ["2024-12-31", "2024-09-30", ...] "rows_returned": int, # number of periods "statement": [ { "period": str, # quarter end date "items": { "<breakdown_name>": float | None, ... } }, ... ] }

get_stock_annual_balance_sheet

Retrieve the annual balance sheet for a given stock symbol. This tool returns balance sheet data structured by year, with each year represented as a record containing standardized balance sheet line items. Returns: dict: { "currency": "USD", "period_type": "annual", "periods": list[str], # e.g. ["2024-12-31", "2023-12-31", ...] "rows_returned": int, # number of periods "statement": [ { "period": str, # year-end date "items": { "<breakdown_name>": float | None, ... } }, ... ] }

get_stock_quarterly_cash_flow

Retrieve the quarterly cash flow for a given stock symbol. This tool returns cash flow data structured by quarter, with each quarter represented as a record containing standardized cash flow line items. Returns: dict: { "currency": "USD", "period_type": "quarterly", "periods": list[str], # e.g. ["2024-12-31", "2024-09-30", ...] "rows_returned": int, # number of periods "statement": [ { "period": str, # quarter end date "items": { "<breakdown_name>": float | None, ... } }, ... ] }

get_stock_annual_cash_flow

Retrieve the annual cash flow for a given stock symbol. This tool returns cash flow data structured by year, with each year represented as a record containing standardized cash flow line items. Returns: dict: { "currency": "USD", "period_type": "annual", "periods": list[str], # e.g. ["2024-12-31", "2023-12-31", ...] "rows_returned": int, # number of periods "statement": [ { "period": str, # year-end date "items": { "<breakdown_name>": float | None, ... } }, ... ] }

get_quarterly_revenue_by_segment

Retrieve quarterly revenue breakdown by business segment for a given stock symbol. Args: symbol (str): Stock ticker symbol (e.g. "TSLA", "AMD", "NVDA"). Returns: dict: { "symbol": str, "period_type": "quarterly", "periods": list[str], # e.g. ["2024-09-30", "2024-12-31", ...] "segments": list[str], # e.g. ["Online Marketing Services", "Transaction Services"] "rows_returned": int, "data": [ { "period": str, "revenue": { "<segment>": float | None, ... }, "currency": "usd" }, ... ] }

get_quarterly_revenue_by_geography

Retrieve quarterly revenue breakdown by geography for a given stock symbol. Args: symbol (str): Stock ticker symbol (e.g. "TSLA", "AMD", "NVDA"). Returns: dict: { "symbol": str, "period_type": "quarterly", "periods": list[str], # e.g. ["2024-09-30", "2024-12-31", ...] "regions": list[str], # e.g. ["China", "United States", "Other"] "rows_returned": int, "data": [ { "period": str, "revenue": { "<region>": float | None, ... }, "currency": "usd" }, ... ] }

get_stock_quarterly_gross_margin

Retrieve quarterly gross margin data for a given stock symbol. Args: symbol (str): Stock ticker symbol (e.g. "TSLA", "AMD", "NVDA"). Returns: dict: { "symbol": str, "currency": "USD", "period_type": "quarterly", "periods": list[str], # report dates (oldest -> newest) "rows_returned": int, "data": [ { "period": str, "gross_profit": decimal | None, "total_revenue": decimal | None, "gross_margin": decimal | None }, ... ] }

get_stock_annual_gross_margin

Retrieve annual gross margin data for a given stock symbol. Args: symbol (str): Stock ticker symbol (e.g. "TSLA", "AMD", "NVDA"). Returns: dict: { "symbol": str, "currency": "USD", "period_type": "annual", "periods": list[str], # report dates (oldest -> newest) "rows_returned": int, "data": [ { "period": str, "gross_profit": decimal | None, "total_revenue": decimal | None, "gross_margin": decimal | None }, ... ] }

get_stock_quarterly_operating_margin

Retrieve quarterly operating margin data for a given stock symbol. Args: symbol (str): Stock ticker symbol (e.g. "TSLA", "AMD", "NVDA"). Returns: dict: { "symbol": str, "currency": "USD", "period_type": "quarterly", "periods": list[str], # report dates (oldest -> newest) "rows_returned": int, "data": [ { "period": str, "operating_income": decimal | None, "total_revenue": decimal | None, "operating_margin": decimal | None }, ... ] }

get_stock_annual_operating_margin

Retrieve annual operating margin data for a given stock symbol. Args: symbol (str): Stock ticker symbol (e.g. "TSLA", "AMD", "NVDA"). Returns: dict: { "symbol": str, "currency": "USD", "period_type": "annual", "periods": list[str], # report dates (oldest -> newest) "rows_returned": int, "data": [ { "period": str, "operating_income": decimal | None, "total_revenue": decimal | None, "operating_margin": decimal | None }, ... ] }

get_stock_quarterly_net_margin

Retrieve quarterly net margin data for a given stock symbol. Args: symbol (str): Stock ticker symbol (e.g. "TSLA", "AMD", "NVDA"). Returns: dict: { "symbol": str, "currency": "USD", "period_type": "quarterly", "periods": list[str], # report dates (oldest -> newest) "rows_returned": int, "data": [ { "period": str, "net_income_common_stockholders": decimal | None, "total_revenue": decimal | None, "net_margin": decimal | None }, ... ] }

get_stock_annual_net_margin

Retrieve annual net margin data for a given stock symbol. Args: symbol (str): Stock ticker symbol (e.g. "TSLA", "AMD", "NVDA"). Returns: dict: { "symbol": str, "currency": "USD", "period_type": "annual", "periods": list[str], # report dates (oldest -> newest) "rows_returned": int, "data": [ { "period": str, "net_income_common_stockholders": decimal | None, "total_revenue": decimal | None, "net_margin": decimal | None }, ... ] }

get_stock_quarterly_ebitda_margin

Retrieve quarterly ebitda margin data for a given stock symbol. Args: symbol (str): Stock ticker symbol (e.g. "TSLA", "AMD", "NVDA"). Returns: dict: { "symbol": str, "currency": "USD", "period_type": "quarterly", "periods": list[str], # report dates (oldest -> newest) "rows_returned": int, "data": [ { "period": str, "ebitda": decimal | None, "total_revenue": decimal | None, "ebitda_margin": decimal | None }, ... ] }

get_stock_annual_ebitda_margin

Retrieve annual ebitda margin data for a given stock symbol. Args: symbol (str): Stock ticker symbol (e.g. "TSLA", "AMD", "NVDA"). Returns: dict: { "symbol": str, "currency": "USD", "period_type": "annual", "periods": list[str], # report dates (oldest -> newest) "rows_returned": int, "data": [ { "period": str, "ebitda": decimal | None, "total_revenue": decimal | None, "ebitda_margin": decimal | None }, ... ] }

get_stock_quarterly_fcf_margin

Retrieve quarterly fcf margin data for a given stock symbol. Args: symbol (str): Stock ticker symbol (e.g. "TSLA", "AMD", "NVDA"). Returns: dict: { "symbol": str, "currency": "USD", "period_type": "quarterly", "periods": list[str], # report dates (oldest -> newest) "rows_returned": int, "data": [ { "period": str, "free_cash_flow": decimal | None, "total_revenue": decimal | None, "fcf_margin": decimal | None }, ... ] }

get_stock_annual_fcf_margin

Retrieve annual fcf margin data for a given stock symbol. Args: symbol (str): Stock ticker symbol (e.g. "TSLA", "AMD", "NVDA"). Returns: dict: { "symbol": str, "currency": "USD", "period_type": "annual", "periods": list[str], # report dates (oldest -> newest) "rows_returned": int, "data": [ { "period": str, "free_cash_flow": decimal | None, "total_revenue": decimal | None, "fcf_margin": decimal | None }, ... ] }

get_industry_quarterly_gross_margin

Retrieve quarterly gross margin for the industry that the given stock symbol belongs to. Args: symbol (str): Stock ticker symbol (e.g. "TSLA", "AMD", "NVDA"). Returns: dict: { "industry": str, "currency": "USD", "period_type": "quarterly", "periods": list[str], # report dates (oldest -> newest) "rows_returned": int, "data": [ { "period": str, "total_gross_profit": float | None, "total_revenue": float | None, "industry_gross_margin": float | None }, ... ] }

get_industry_quarterly_net_margin

Retrieve quarterly net margin for the industry that the given stock symbol belongs to. Args: symbol (str): Stock ticker symbol (e.g. "TSLA", "AMD", "NVDA"). Returns: dict: { "industry": str, "currency": "USD", "period_type": "quarterly", "periods": list[str], # report dates (oldest -> newest) "rows_returned": int, "data": [ { "period": str, "total_net_income": float | None, "total_revenue": float | None, "industry_net_margin": float | None }, ... ] }

get_industry_quarterly_ebitda_margin

Retrieve quarterly ebitda margin for the industry that the given stock symbol belongs to. Args: symbol (str): Stock ticker symbol (e.g. "TSLA", "AMD", "NVDA"). Returns: dict: { "industry": str, "currency": "USD", "period_type": "quarterly", "periods": list[str], # report dates (oldest -> newest) "rows_returned": int, "data": [ { "period": str, "total_ebitda": float | None, "total_revenue": float | None, "industry_ebitda_margin": float | None }, ... ] }

get_stock_eps_and_ttm_eps

Retrieve quarterly EPS and trailing twelve months (TTM) EPS for a given stock symbol. This function returns a time-series dataset where each record represents a fiscal quarter, including: - EPS for the quarter - TTM EPS calculated up to that quarter Args: symbol (str): Stock ticker symbol (e.g. "TSLA", "AMD", "NVDA"). Returns: dict: { "symbol": str, "currency": "USD", "rows_returned": int, "data": [ { "report_date": str, # e.g. "2024-12-31" "eps": decimal | None, # quarterly EPS "ttm_eps": decimal | None # Trailing Twelve Months EPS }, ... ] }

get_stock_ttm_pe

Retrieve historical TTM P/E (price-to-earnings) ratio for a given stock symbol. Args: symbol: Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). start_date: Optional start date in YYYY-MM-DD format (e.g., "2015-12-30"). If None, data starts from the earliest available date. end_date: Optional end date in YYYY-MM-DD format (e.g., "2025-12-24"). If None, data goes up to the most recent trading day. Returns: dict: { "symbol": str, "currency": "USD", "date_range": str, # Actual date range returned "rows_returned": int, # Number of rows "truncated": bool, # True if rows were truncated due to MAX_ROWS "data": list[dict], # List of records with: - report_date (str): # Date of stock price observation - eps_report_date (str): # The fiscal quarter-end date of the latest earnings used to compute TTM EPS - close_price (decimal): # Stock closing price on report_date - ttm_diluted_eps (decimal | None): # Most recent four-quarter Diluted EPS - ttm_pe (decimal | None): # P/E ratio = close_price / ttm_diluted_eps } Important note on data limits: To prevent responses from becoming too large for the language model to process (which can cause errors or token limit exceeded issues), this tool caps the maximum number of rows returned at 1000 (MAX_ROWS = 1000). When the requested range contains more than 1000 rows, only the most recent 1000 trading days are returned, and "truncated": true is set. If you need data further back: - Make multiple calls with different (earlier) date ranges - Or call with a narrower start_date/end_date to stay under the limit Note: Unless explicitly stated otherwise, this tool operates on data that is current up to the latest data update date returned by `get_latest_data_update_date`. Use that date as the authoritative reference point ("today") when interpreting date ranges or relative time expressions.

get_stock_market_capitalization

Retrieve historical market capitalization data for a given stock symbol. Args: symbol: Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). start_date: Optional start date in YYYY-MM-DD format (e.g., "2015-12-30"). If None, data starts from the earliest available date. end_date: Optional end date in YYYY-MM-DD format (e.g., "2025-12-24"). If None, data goes up to the most recent trading day. Returns: dict: { "symbol": str, "currency": "USD", "date_range": str, # Actual date range returned "rows_returned": int, # Number of rows "truncated": bool, # True if rows were truncated due to MAX_ROWS "data": list[dict], # List of records with: - report_date (str): # Date of stock price observation - shares_report_date (str): # Reporting date of shares outstanding - close_price (decimal): # Stock closing price on report_date - shares_outstanding (decimal): # Total shares outstanding as of shares_report_date - market_capitalization (decimal): # Market cap = close_price × shares_outstanding } Important note on data limits: To prevent responses from becoming too large for the language model to process (which can cause errors or token limit exceeded issues), this tool caps the maximum number of rows returned at 1000 (MAX_ROWS = 1000). When the requested range contains more than 1000 rows, only the most recent 1000 trading days are returned, and "truncated": true is set. If you need data further back: - Make multiple calls with different (earlier) date ranges - Or call with a narrower start_date/end_date to stay under the limit Note: Unless explicitly stated otherwise, this tool operates on data that is current up to the latest data update date returned by `get_latest_data_update_date`. Use that date as the authoritative reference point ("today") when interpreting date ranges or relative time expressions.

get_stock_ps_ratio

Retrieve historical Price-to-Sales (P/S) ratio for a given stock symbol. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). start_date (str, optional): Start date in YYYY-MM-DD format. Filters data where report_date >= start_date. If None, data starts from the earliest available date. end_date (str, optional): End date in YYYY-MM-DD format. Filters data where report_date <= end_date. If None, data goes up to the most recent trading day. Returns: dict: { "symbol": str, "currency": "USD", "date_range": str, # Actual date range returned "rows_returned": int, # Number of rows "truncated": bool, # True if rows were truncated due to MAX_ROWS "data": list[dict], # List of records with: - report_date (str): # Date of stock price observation - fiscal_quarter (str): # Fiscal quarter-end date of the latest financial report used to compute TTM revenue. - market_capitalization (decimal): # Total equity market value on report_date. - ttm_revenue_usd (decimal): # Trailing Twelve Months (TTM) revenue in USD = Trailing Twelve Months (TTM) revenue / Exchange Rate - ps_ratio (decimal): # ps_ratio = market_capitalization / ttm_revenue_usd } Important note on data limits: To prevent responses from becoming too large for the language model to process (which can cause errors or token limit exceeded issues), this tool caps the maximum number of rows returned at 1000 (MAX_ROWS = 1000). When the requested range contains more than 1000 rows, only the most recent 1000 trading days are returned, and "truncated": true is set. If you need data further back: - Make multiple calls with different (earlier) date ranges - Or call with a narrower start_date/end_date to stay under the limit Note: Unless explicitly stated otherwise, this tool operates on data that is current up to the latest data update date returned by `get_latest_data_update_date`. Use that date as the authoritative reference point ("today") when interpreting date ranges or relative time expressions.

get_stock_pb_ratio

Retrieve historical Price-to-Book (P/B) ratio for a given stock symbol. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). start_date (str, optional): Start date in YYYY-MM-DD format. Filters data where report_date >= start_date. If None, data starts from the earliest available date. end_date (str, optional): End date in YYYY-MM-DD format. Filters data where report_date <= end_date. If None, data goes up to the most recent trading day. Returns: dict: { "symbol": str, "currency": "USD", "date_range": str, # Actual date range returned "rows_returned": int, # Number of rows "truncated": bool, # True if rows were truncated due to MAX_ROWS "data": list[dict], # List of records with: - report_date (str): # Date of stock price observation - fiscal_quarter (str): # Fiscal quarter-end date of the latest financial report used to compute TTM revenue. - market_capitalization (decimal): # Total equity market value on report_date. - book_value_of_equity_usd (decimal): # Book value of equity in USD = Stockholders' Equity / Exchange Rate - pb_ratio (decimal): # pb_ratio = market_capitalization / book_value_of_equity_usd } Important note on data limits: To prevent responses from becoming too large for the language model to process (which can cause errors or token limit exceeded issues), this tool caps the maximum number of rows returned at 1000 (MAX_ROWS = 1000). When the requested range contains more than 1000 rows, only the most recent 1000 trading days are returned, and "truncated": true is set. If you need data further back: - Make multiple calls with different (earlier) date ranges - Or call with a narrower start_date/end_date to stay under the limit Note: Unless explicitly stated otherwise, this tool operates on data that is current up to the latest data update date returned by `get_latest_data_update_date`. Use that date as the authoritative reference point ("today") when interpreting date ranges or relative time expressions.

get_stock_peg_ratio

Retrieve historical Price-to-Earnings Growth (PEG) ratios for a given stock symbol, based on both earnings growth and revenue growth. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). start_date (str, optional): Start date in YYYY-MM-DD format. Filters data where report_date >= start_date. If None, data starts from the earliest available date. end_date (str, optional): End date in YYYY-MM-DD format. Filters data where report_date <= end_date. If None, data goes up to the most recent trading day. Returns: dict: { "symbol": str, "date_range": str, # Actual date range returned "rows_returned": int, # Number of rows "truncated": bool, # True if rows were truncated due to MAX_ROWS "data": list[dict], # List of records with: - report_date (str): # Date of stock price observation - fiscal_quarter (str): # Fiscal quarter-end date of the latest financial report - ttm_pe (decimal | None): # Trailing Twelve Months P/E ratio, based on diluted EPS - eps_yoy_growth (decimal | None): # Year-over-year growth rate of TTM diluted EPS - peg_ratio_by_eps (decimal | None): # PEG based on earnings growth = ttm_pe / eps_yoy_growth - revenue_yoy_growth (decimal | None): # Year-over-year growth rate of TTM revenue - peg_ratio_by_revenue (decimal | None): # PEG based on revenue growth = ttm_pe / revenue_yoy_growth } Important note on data limits: To prevent responses from becoming too large for the language model to process (which can cause errors or token limit exceeded issues), this tool caps the maximum number of rows returned at 1000 (MAX_ROWS = 1000). When the requested range contains more than 1000 rows, only the most recent 1000 trading days are returned, and "truncated": true is set. If you need data further back: - Make multiple calls with different (earlier) date ranges - Or call with a narrower start_date/end_date to stay under the limit Note: Unless explicitly stated otherwise, this tool operates on data that is current up to the latest data update date returned by `get_latest_data_update_date`. Use that date as the authoritative reference point ("today") when interpreting date ranges or relative time expressions.

get_stock_quarterly_roe

Retrieve historical Return on Equity (ROE) data for a given stock symbol. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "currency": str, # Reporting currency (e.g., "USD") "period_type": "quarterly", # ROE is reported on quarterly basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - net_income_common_stockholders (decimal): # Net income attributable to common stockholders - beginning_stockholders_equity (decimal): # Stockholders' equity at the beginning of the period (i.e., prior period ending equity) - ending_stockholders_equity (decimal): # Stockholders' equity at the end of the current period - avg_equity (decimal): # Average stockholders' equity = (beginning_stockholders_equity + ending_stockholders_equity) / 2 - roe (decimal): # Return on Equity = net_income_common_stockholders / avg_equity }

get_stock_quarterly_roa

Retrieve historical Return on Assert (ROA) data for a given stock symbol. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "currency": str, # Reporting currency (e.g., "USD") "period_type": "quarterly", # ROA is reported on quarterly basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - net_income_common_stockholders (decimal): # Net income attributable to common stockholders - beginning_total_assets (decimal): # Total assets at the beginning of the quarter (i.e., total assets from the prior quarter). - ending_total_assets (decimal): # Total assets at the end of the current quarter. - avg_assets (decimal): # Average total assets = (beginning_total_assets + ending_total_assets) / 2 - roa (decimal): # Return on Assert = net_income_common_stockholders / avg_assets }

get_stock_quarterly_roic

Retrieve historical Return on Invested Capital (ROIC) data for a given stock symbol. [!WARN] ROIC is generally NOT applicable to banks and other financial institutions, due to their fundamentally different balance sheet structures. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "currency": str, # Reporting currency (e.g., "USD") "period_type": "quarterly", # ROIC is reported on a quarterly basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - ebit (decimal): # Earnings Before Interest and Taxes (operating income) - tax_rate_for_calcs (decimal): # Effective tax rate used for ROIC calculation - nopat (decimal): # Net Operating Profit After Tax = ebit * (1 - tax_rate_for_calcs) - beginning_invested_capital (decimal): # Invested capital at the beginning of the quarter (i.e., invested capital from the prior quarter) - ending_invested_capital (decimal): # Invested capital at the end of the current quarter - avg_invested_capital (decimal): # Average invested capital = (beginning_invested_capital + ending_invested_capital) / 2 - roic (decimal): # Return on Invested Capital = nopat / avg_invested_capital }

get_stock_quarterly_equity_multiplier

Retrieve historical Equity Multiplier data for a given stock symbol. [!WARN] Equity Multiplier does not apply to banks or other financial institutions, as their balance sheet structures and leverage dynamics are fundamentally different from non-financial companies. In DuPont Analysis, the Equity Multiplier can be derived from ROE and ROA: Equity Multiplier = ROE / ROA Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "period_type": "quarterly", # Equity Multiplier is reported on a quarterly basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - roe (decimal): # Return on Equity (ROE) - roa (decimal): # Return on Assets (ROA) - equity_multiplier (decimal): # Financial leverage measure }

get_stock_quarterly_asset_turnover

Retrieve historical Assert Turnover data for a given stock symbol. In DuPont Analysis, the Assert Turnover can be derived from ROA and Net Margin: Assert Turnover = ROA / Net Margin Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "period_type": "quarterly", # Equity Multiplier is reported on a quarterly basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - roa (decimal): # Return on Assets (ROA) - net_margin (decimal): # Net Income Margin - asset_turnover (decimal): # Asset Turnover }

get_industry_ttm_pe

Retrieve historical industry-level TTM Price-to-Earnings (P/E) ratio for the industry to which a given stock symbol belongs. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Used to identify the corresponding industry. start_date (str, optional): Start date in YYYY-MM-DD format. Filters data where report_date >= start_date. If None, data starts from the earliest available date. end_date (str, optional): End date in YYYY-MM-DD format. Filters data where report_date <= end_date. If None, data goes up to the most recent available date. Returns: dict: { "symbol": str, "currency": "USD", "date_range": str, # Actual date range returned "rows_returned": int, # Number of rows returned "truncated": bool, # True if rows were truncated due to MAX_ROWS "data": list[dict], # List of records with: - report_date (str): # Observation date (YYYY-MM-DD) - industry (str): # Industry name - total_market_cap (decimal): # Sum of market capitalization of all companies in the industry - total_ttm_net_income (decimal): # Sum of TTM net income of all companies in the industry - industry_ttm_pe (decimal | None) # Industry TTM P/E ratio = total_market_cap / total_ttm_net_income } Important note on data limits: To prevent responses from becoming too large for the language model to process (which can cause errors or token limit exceeded issues), this tool caps the maximum number of rows returned at 1000 (MAX_ROWS = 1000). When the requested range contains more than 1000 rows, only the most recent 1000 trading days are returned, and "truncated": true is set. If you need data further back: - Make multiple calls with different (earlier) date ranges - Or call with a narrower start_date/end_date to stay under the limit Note: Unless explicitly stated otherwise, this tool operates on data that is current up to the latest data update date returned by `get_latest_data_update_date`. Use that date as the authoritative reference point ("today") when interpreting date ranges or relative time expressions.

get_industry_ps_ratio

Retrieve historical industry-level Price-to-Sales (P/S) ratio for the industry to which a given stock symbol belongs. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Used to identify the corresponding industry. start_date (str, optional): Start date in YYYY-MM-DD format. Filters data where report_date >= start_date. If None, data starts from the earliest available date. end_date (str, optional): End date in YYYY-MM-DD format. Filters data where report_date <= end_date. If None, data goes up to the most recent available date. Returns: dict: { "symbol": str, "currency": "USD", "date_range": str, # Actual date range returned "rows_returned": int, # Number of rows returned "truncated": bool, # True if rows were truncated due to MAX_ROWS "data": list[dict], # List of records with: - report_date (str): # Observation date (YYYY-MM-DD) - industry (str): # Industry name - total_market_cap (decimal): # Sum of market capitalization of all companies in the industry - total_ttm_revenue (decimal): # Sum of trailing twelve months (TTM) revenue of all companies - industry_ps_ratio (decimal): # Industry-level Price-to-Sales ratio = total_market_cap / total_ttm_revenue } Important note on data limits: To prevent responses from becoming too large for the language model to process (which can cause errors or token limit exceeded issues), this tool caps the maximum number of rows returned at 1000 (MAX_ROWS = 1000). When the requested range contains more than 1000 rows, only the most recent 1000 trading days are returned, and "truncated": true is set. If you need data further back: - Make multiple calls with different (earlier) date ranges - Or call with a narrower start_date/end_date to stay under the limit Note: Unless explicitly stated otherwise, this tool operates on data that is current up to the latest data update date returned by `get_latest_data_update_date`. Use that date as the authoritative reference point ("today") when interpreting date ranges or relative time expressions.

get_industry_pb_ratio

Retrieve historical industry-level Price-to-Book (P/B) ratio for the industry to which a given stock symbol belongs. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Used to identify the corresponding industry. start_date (str, optional): Start date in YYYY-MM-DD format. Filters data where report_date >= start_date. If None, data starts from the earliest available date. end_date (str, optional): End date in YYYY-MM-DD format. Filters data where report_date <= end_date. If None, data goes up to the most recent available date. Returns: dict: { "symbol": str, "currency": "USD", "date_range": str, # Actual date range returned "rows_returned": int, # Number of rows returned "truncated": bool, # True if rows were truncated due to MAX_ROWS "data": list[dict], # List of records with: - report_date (str): # Observation date (YYYY-MM-DD) - industry (str): # Industry name - total_market_cap (decimal): # Sum of market capitalization of all stocks in the industry (in USD) - total_bve (decimal): # Sum of the book value of equity of all stocks in the industry (in USD) - industry_pb_ratio (decimal): # Industry-level Price-to-Book ratio = total_market_cap / total_book_value_of_equity } Important note on data limits: To prevent responses from becoming too large for the language model to process (which can cause errors or token limit exceeded issues), this tool caps the maximum number of rows returned at 1000 (MAX_ROWS = 1000). When the requested range contains more than 1000 rows, only the most recent 1000 trading days are returned, and "truncated": true is set. If you need data further back: - Make multiple calls with different (earlier) date ranges - Or call with a narrower start_date/end_date to stay under the limit Note: Unless explicitly stated otherwise, this tool operates on data that is current up to the latest data update date returned by `get_latest_data_update_date`. Use that date as the authoritative reference point ("today") when interpreting date ranges or relative time expressions.

get_industry_quarterly_roe

Retrieve historical industry-level Return on Equity (ROE) data for the industry to which a given stock symbol belongs. Args: symbol (str): Stock ticker symbol used to identify the corresponding industry, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "currency": str, # Reporting currency (e.g., "USD") "period_type": "quarterly", # Industry ROE is reported on a quarterly basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - industry (str): # Industry name - total_net_income_common_stockholders (decimal): # Sum of net income attributable to common stockholders across all stocks in the industry - total_avg_equity (decimal): # For each stock, compute its average shareholders' equity as avg_equity(symbol), then calculate total_avg_equity = Σ avg_equity(symbol). - industry_roe (decimal): # Industry ROE = total_net_income_common_stockholders / total_avg_equity }

get_industry_quarterly_roa

Retrieve historical industry-level Return on Assets (ROA) data for the industry corresponding to a given stock symbol. Args: symbol (str): Stock ticker symbol used to identify the industry (e.g., "TSLA", "AAPL"). Case-insensitive. Returns: dict: { "symbol": str, # Input stock symbol "currency": str, # Reporting currency (e.g., "USD") "period_type": "quarterly", # Industry ROA is reported quarterly "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - industry (str): # Industry name - total_net_income_common_stockholders (decimal): # Sum of net income attributable to common stockholders across all stocks in the industry - total_avg_asserts (decimal): # For each stock, compute its average assets as avg_asserts(symbol), then calculate total_avg_asserts = Σ avg_asserts(symbol). - industry_roa (decimal): # Industry Return on Assets }

get_industry_quarterly_equity_multiplier

Retrieve historical industry-level Equity Multiplier data for the industry to which a given stock symbol belongs. In DuPont Analysis, the Equity Multiplier can be derived from ROE and ROA: Industry Equity Multiplier = Industry ROE / Industry ROA Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "currency": str, # Reporting currency (e.g., "USD") "period_type": "quarterly", # Industry metrics are reported on a quarterly basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - industry (str): # Industry name - industry_roe (decimal): # Industry Return on Equity - industry_roa (decimal): # Industry Return on Assets - industry_equity_multiplier (decimal): # Industry Equity Multiplier, derived from DuPont Analysis }

get_industry_quarterly_asset_turnover

Retrieve historical industry-level Assert Turnover data for the industry to which a given stock symbol belongs. In DuPont Analysis, the Assert Turnover can be derived from ROA and Net Margin: Industry Assert Turnover = Industry ROA / Industry Net Margin Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "period_type": "quarterly", # Equity Multiplier is reported on a quarterly basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - industry(str) # Industry name - industry_roa (decimal): # Return on Assets (ROA) - industry_net_margin (decimal): # Net Income Margin - industry_asset_turnover (decimal): # Asset Turnover }

get_stock_quarterly_revenue_yoy_growth

Retrieve historical quarterly Year-over-Year (YoY) revenue growth data for a given stock symbol. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "currency": str, # Reporting currency (e.g., "USD") "period_type": "quarterly", # Revenue growth is measured on a quarterly basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - revenue (decimal | None): # Revenue for the current quarter - prev_year_revenue (decimal | None): # Revenue from the same fiscal quarter in the prior year - yoy_growth (decimal | None): # Year-over-Year revenue growth rate }

get_stock_annual_revenue_yoy_growth

Retrieve historical annual Year-over-Year (YoY) revenue growth data for a given stock symbol. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "currency": str, # Reporting currency (e.g., "USD") "period_type": "annual", # Revenue growth is measured on a annual basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - revenue (decimal | None): # Revenue for the current quarter - prev_year_revenue (decimal | None): # Revenue from the same fiscal quarter in the prior year - yoy_growth (decimal | None): # Year-over-Year revenue growth rate }

get_stock_quarterly_operating_income_yoy_growth

Retrieve historical quarterly Year-over-Year (YoY) operating income growth data for a given stock symbol. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "currency": str, # Reporting currency (e.g., "USD") "period_type": "quarterly", # Operating income growth is measured on a quarterly basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - operating_income (decimal | None): # Operating income for the current quarter - prev_year_operating_income (decimal | None): # Operating income from the same fiscal quarter in the prior year - yoy_growth (decimal | None): # Year-over-Year Operating income growth rate }

get_stock_annual_operating_income_yoy_growth

Retrieve historical annual Year-over-Year (YoY) operating income growth data for a given stock symbol. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "currency": str, # Reporting currency (e.g., "USD") "period_type": "annual", # Operating income growth is measured on a annual basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - operating_income (decimal | None): # Operating income for the current quarter - prev_year_operating_income (decimal | None): # Operating income from the same fiscal quarter in the prior year - yoy_growth (decimal | None): # Year-over-Year Operating income growth rate }

get_stock_quarterly_ebitda_yoy_growth

Retrieve historical quarterly Year-over-Year (YoY) EBITDA growth data for a given stock symbol. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "currency": str, # Reporting currency (e.g., "USD") "period_type": "quarterly", # EBITDA growth is measured on a quarterly basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - ebitda (decimal | None): # EBITDA for the current quarter - prev_year_ebitda (decimal | None): # EBITDA from the same fiscal quarter in the prior year - yoy_growth (decimal | None): # Year-over-Year EBITDA growth rate }

get_stock_annual_ebitda_yoy_growth

Retrieve historical annual Year-over-Year (YoY) EBITDA growth data for a given stock symbol. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "currency": str, # Reporting currency (e.g., "USD") "period_type": "annual", # EBITDA growth is measured on a annual basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - ebitda (decimal | None): # EBITDA for the current quarter - prev_year_ebitda (decimal | None): # EBITDA from the same fiscal quarter in the prior year - yoy_growth (decimal | None): # Year-over-Year EBITDA growth rate }

get_stock_quarterly_net_income_yoy_growth

Retrieve historical quarterly Year-over-Year (YoY) Net Income growth data for a given stock symbol. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "currency": str, # Reporting currency (e.g., "USD") "period_type": "quarterly", # Net Income growth is measured on a quarterly basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - net_income_common_stockholders (decimal | None): # Net Income for the current quarter - prev_year_net_income_common_stockholders (decimal | None): # Net Income from the same fiscal quarter in the prior year - yoy_growth (decimal | None): # Year-over-Year Net Income growth rate }

get_stock_annual_net_income_yoy_growth

Retrieve historical annual Year-over-Year (YoY) Net Income growth data for a given stock symbol. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "currency": str, # Reporting currency (e.g., "USD") "period_type": "annual", # Net Income growth is measured on a annual basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - net_income_common_stockholders (decimal | None): # Net Income for the current quarter - prev_year_net_income_common_stockholders (decimal | None): # Net Income from the same fiscal quarter in the prior year - yoy_growth (decimal | None): # Year-over-Year Net Income growth rate }

get_stock_quarterly_fcf_yoy_growth

Retrieve historical quarterly Year-over-Year (YoY) Free cash flow growth data for a given stock symbol. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "currency": str, # Reporting currency (e.g., "USD") "period_type": "quarterly", # Free cash flow growth is measured on a quarterly basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - free_cash_flow (decimal | None): # Free cash flow for the current quarter - prev_year_free_cash_flow (decimal | None): # Free cash flow from the same fiscal quarter in the prior year - yoy_growth (decimal | None): # Year-over-Year Free cash flow growth rate }

get_stock_annual_fcf_yoy_growth

Retrieve historical annual Year-over-Year (YoY) Free cash flow growth data for a given stock symbol. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "currency": str, # Reporting currency (e.g., "USD") "period_type": "annual", # Free cash flow growth is measured on a annual basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - free_cash_flow (decimal | None): # Free cash flow for the current quarter - prev_year_free_cash_flow (decimal | None): # Free cash flow from the same fiscal quarter in the prior year - yoy_growth (decimal | None): # Year-over-Year Free cash flow growth rate }

get_stock_quarterly_diluted_eps_yoy_growth

Retrieve historical quarterly Year-over-Year (YoY) Diluted EPS growth data for a given stock symbol. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "currency": str, # Reporting currency (e.g., "USD") "period_type": "quarterly", # Diluted EPS growth is measured on a quarterly basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - diluted_eps (decimal | None): # Diluted EPS for the current quarter - prev_year_diluted_eps (decimal | None): # Diluted EPS from the same fiscal quarter in the prior year - yoy_growth (decimal | None): # Year-over-Year Diluted EPS growth rate }

get_stock_quarterly_ttm_diluted_eps_yoy_growth

Retrieve historical quarterly Year-over-Year (YoY) TTM Diluted EPS growth data for a given stock symbol. Args: symbol (str): Stock ticker symbol, e.g., "TSLA", "AAPL" (case-insensitive). Returns: dict: { "symbol": str, "currency": str, # Reporting currency (e.g., "USD") "period_type": "quarterly", # TTM Diluted EPS growth is measured on a quarterly basis "periods": list[str], # List of fiscal period end dates "rows_returned": int, # Number of periods returned "data": list[dict], # List of records with: - period (str): # Fiscal period end date - ttm_diluted_eps (decimal | None): # TTM Diluted EPS for the current quarter - prev_year_ttm_diluted_eps (decimal | None): # TTM Diluted EPS from the same fiscal quarter in the prior year - yoy_growth (decimal | None): # Year-over-Year TTM Diluted EPS growth rate }

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "defeatbeta api": {
            "defeatbeta-api": {
                "command": "/Users/kevin.zheng/.defeatbeta/mcp/run.sh",
                "description": "An open-source alternative to Yahoo Finance's market data APIs with higher reliability.",
                "provider": "Defeat Beta API",
                "providerUrl": "https://github.com/defeat-beta/defeatbeta-api",
                "timeout": 600,
                "logoUrl": "https://github.com/defeat-beta/defeatbeta-api/blob/main/doc/favicon.ico?raw=true",
                "args": []
            }
        }
    }
}

McpServers

{
    "defeatbeta-api": {
        "command": "/Users/kevin.zheng/.defeatbeta/mcp/run.sh",
        "description": "An open-source alternative to Yahoo Finance's market data APIs with higher reliability.",
        "provider": "Defeat Beta API",
        "providerUrl": "https://github.com/defeat-beta/defeatbeta-api",
        "timeout": 600,
        "logoUrl": "https://github.com/defeat-beta/defeatbeta-api/blob/main/doc/favicon.ico?raw=true",
        "args": []
    }
}
# Defeat Beta API MCP **Defeat Beta API MCP** is an [MCP](https://modelcontextprotocol.io/introduction) server that exposes data from [defeatbeta-api](https://github.com/defeat-beta/defeatbeta-api) to large language models via standardized contextual interfaces, enabling structured and controlled financial data analysis. Click [here](../doc/mcp/README.md) to discover more ways to use MCP and explore additional use cases and best practices. ## Overall Architecture ```text ┌──────────────────────┐ │ MCP Client │ │ (Claude Desktop / │ │ Manus AI / │ │ Cherry Studio / │ │ Other MCP Clients) │ └──────────┬───────────┘ │ MCP (stdio) │ JSON-RPC ▼ ┌──────────────────────────────┐ │ Defeat Beta API MCP Server │ │ │ │ - MCP Tool Definitions │ │ - Context Construction │ │ - Windowing / Summarization │ │ - Output Shaping for LLM │ │ │ │ (runs in isolated .venv) │ └──────────┬───────────────────┘ │ │ Python API Calls ▼ ┌──────────────────────────────┐ │ defeatbeta-api │ │ (Published PyPI Package) │ │ │ │ - Market Data Access │ │ - Price / History / Metrics │ │ │ └──────────┬───────────────────┘ │ ▼ ┌──────────────────────────────┐ │ Financial Data Sources │ │ (via defeatbeta-api) │ └──────────────────────────────┘ ``` ## Installation - Method 1: Run with uvx (Recommended) - Method 2: One-line Install Script (Optional) ### Method 1: Run with `uvx` (Recommended) The recommended way to run **Defeat Beta API MCP** is using `uvx`. You need to install it first by running `pip install uv`. This method requires **no manual installation**, **no virtual environment management**, and works seamlessly with MCP-native clients such as **Manus**, **Cherry Studio**, and **Claude Desktop**. **Step 1: Pre-warm the cache (first time only)** Before adding the MCP server to your client, run the following command once to download and cache the package locally: ```shell uvx --refresh "git+https://github.com/defeat-beta/defeatbeta-api.git#subdirectory=mcp" ``` > This step is required because MCP clients have a 60-second initialization timeout. The first download from GitHub may exceed this limit and cause a connection failure. After the cache is warm, subsequent startups take under 2 seconds. **Step 2: MCP Configuration:** ```json { "mcpServers": { "defeatbeta-api": { "command": "uvx", "args": [ "git+https://github.com/defeat-beta/defeatbeta-api.git#subdirectory=mcp" ] } } } ``` Once added, your MCP client will automatically: - Load the cached package - Launch the MCP server in stdio mode No further setup is required. **Set HTTP Proxy (if you’re in a region where cannot access [the Hugging Face Dataset](https://huggingface.co/datasets/defeatbeta/yahoo-finance-data)):** ```json { "mcpServers": { "defeatbeta-api": { ... "env": { "DEFEATBETA_GATEWAY": "http://127.0.0.1:8118" } } } } ``` ### Method 2: One-line Install Script #### macOS or Linux Run script to install: ```shell curl -sSL https://raw.githubusercontent.com/defeat-beta/defeatbeta-api/main/mcp/install | bash ``` #### What this script does <details> <summary>The installation script will automatically perform the following steps:</summary> 1. **Installation Location** * The MCP server will be installed to the local directory: ```text ~/.defeatbeta/ ``` * This directory contains all code and runtime resources required by the MCP server and can be safely removed to uninstall. 2. **Create an Isolated Python Virtual Environment** * An isolated Python virtual environment will be created at: ```text ~/.defeatbeta/.venv ``` * All dependencies are installed exclusively within this environment and will not affect the system Python installation or other projects. 3. **Download and Install MCP Server Entry Scripts** * MCP-related files are downloaded from the `defeatbeta-api` repository. * The script installs and configures `mcp/run.sh` as the unified entry point for starting the MCP server. 4. **Install Runtime Dependencies** * Installs the MCP protocol implementation and required runtime dependencies (including `defeatbeta-api`). * Dependencies are resolved and installed once during installation, avoiding repeated downloads or installations at runtime. 5. **Installed Directory Structure** > After installation, the directory structure is as follows: ```text ~/.defeatbeta/ ├── .venv/ # Isolated Python virtual environment (used by MCP Server) │ ├── bin/ │ └── lib/ │ ├── mcp/ # MCP Server implementation │ ├── run.sh # MCP Server entry script (stdio mode) │ ├── install # Installation script (for curl | bash) │ └── src/ │ └── defeatbeta_mcp/ │ └── server.py # MCP Server main entry │ └── README.md # Local documentation ``` **Notes:** * `run.sh` Serves as the single entry point to start the MCP Server, compatible with stdio-based MCP clients. * `.venv/` Contains all dependencies required to run the MCP Server in an isolated environment. * `src/defeatbeta_mcp/server.py` Core implementation of the MCP Server, responsible for exposing `defeatbeta-api` data as MCP tools. </details> ## Usage - Use in Claude Desktop - Use in Manus ### Use in [Claude Desktop](https://claude.ai/desktop/directory) #### 1. Add MCP Server in Claude Desktop Navigate to **Settings → Developer → Local MCP servers → Edit Config** Open the `claude_desktop_config.json` file and add the following MCP server configuration: ```json { "mcpServers": { "defeatbeta-api": { "command": "uvx", "args": [ "git+https://github.com/defeat-beta/defeatbeta-api.git#subdirectory=mcp" ] } } } ``` After saving the file, restart **Claude for Desktop** to apply the changes. Once the configuration is complete, hover over the **"Connectors"** menu to verify that **`defeatbeta-api`** appears in the list. ![img_2.png](../doc/mcp/claude_config_3.png) > **Troubleshooting:** If **`defeatbeta-api`** does not appear in the Connectors menu, or shows a **failed** status like below, run the following command to pre-warm the local cache, then restart Claude for Desktop: > > ![claude_mcp_failed.png](../doc/mcp/claude_mcp_failed.png) > > ```shell > uvx --refresh "git+https://github.com/defeat-beta/defeatbeta-api.git#subdirectory=mcp" > ``` #### 2. Talk to LLM with MCP Once the MCP Server is configured and successfully connected, you can directly ask questions to the AI in Claude, for example: <details> <summary>📷 Click to view example screenshot</summary> ![Claude MCP Example](../doc/mcp/claude_config_4.png) </details> ### Use in [Manus](https://manus.im/app) #### 1. Add MCP Server in Manus Navigate to **Personalization center → Connectors → Add connectors → Custom MCP → Import by JSON** and add the following MCP server configuration: ```json { "mcpServers": { "defeatbeta-api": { "command": "uvx", "args": [ "--refresh", "git+https://github.com/defeat-beta/defeatbeta-api.git#subdirectory=mcp" ], "note": "An open-source alternative to Yahoo Finance's market data APIs with higher reliability.", "icon": "https://github.com/defeat-beta/defeatbeta-api/blob/main/doc/favicon.ico?raw=true" } } } ``` **Once configured, the result looks like this:** ![img.png](../doc/mcp/manus_mcp_config.png) #### 2. Talk to LLM with MCP Once the MCP Server is configured and successfully connected, you can directly ask questions to the AI in Manus, for example: <details> <summary>📷 Click to view example screenshot</summary> ![img.png](../doc/mcp/Talk_With_Manus.png) </details>
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.