Skip to main content
Glama

load_all_tickers

Retrieves all stock ticker symbols and company names from KOSPI and KOSDAQ exchanges for data analysis and reference.

Instructions

Loads all ticker symbols and names for KOSPI and KOSDAQ into memory.

Returns: Dict[str, str]: A dictionary mapping tickers to stock names. Example: {"005930": "삼성전자", "035720": "카카오", ...}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'load_all_tickers' tool. It loads all KOSPI and KOSDAQ ticker symbols and names using pykrx APIs, caches them in a global TICKER_MAP dictionary, and returns the map or an error.
    def load_all_tickers() -> Dict[str, str]: """Loads all ticker symbols and names for KOSPI and KOSDAQ into memory. Returns: Dict[str, str]: A dictionary mapping tickers to stock names. Example: {"005930": "삼성전자", "035720": "카카오", ...} """ try: global TICKER_MAP # If TICKER_MAP already has data, return it if TICKER_MAP: logging.debug(f"Returning cached ticker information with {len(TICKER_MAP)} stocks") return TICKER_MAP logging.debug("No cached data found. Loading KOSPI/KOSDAQ ticker symbols") # Retrieve data based on today's date today = get_nearest_business_day_in_a_week() logging.debug(f"Reference date: {today}") # get_market_ticker_and_name() returns a Series, # where the index is the ticker and the values are the stock names kospi_series = get_market_ticker_and_name(today, market="KOSPI") kosdaq_series = get_market_ticker_and_name(today, market="KOSDAQ") # Convert Series to dictionaries and merge them TICKER_MAP.update(kospi_series.to_dict()) TICKER_MAP.update(kosdaq_series.to_dict()) logging.debug(f"Successfully stored information for {len(TICKER_MAP)} stocks") return TICKER_MAP except Exception as e: error_message = f"Failed to retrieve ticker information: {str(e)}" logging.error(error_message) return {"error": error_message}

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dragon1086/kospi-kosdaq-stock-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server