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}
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the operation ('loads into memory') and return format, but lacks details on performance characteristics (e.g., loading time, memory usage), error handling, or data freshness. The description adds basic context but misses deeper behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with two sentences: one stating the purpose and scope, and another detailing the return format with a clear example. Every sentence adds essential value without redundancy, making it easy to parse and understand quickly.

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?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is reasonably complete. It covers purpose, scope, and return format with an example. However, it could benefit from additional context like data source or update frequency to fully compensate for the lack of annotations and output schema.

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?

The tool has zero parameters with 100% schema description coverage, so the schema already fully documents the input structure. The description appropriately doesn't add parameter details, maintaining focus on the tool's purpose and output. Baseline 4 is applied as per rules for zero-parameter tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Loads all ticker symbols and names') and resource ('for KOSPI and KOSDAQ into memory'), distinguishing it from sibling tools that focus on specific data like OHLCV, fundamentals, or market cap. It explicitly defines the scope as comprehensive ticker loading rather than filtered queries.

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

Usage Guidelines4/5

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

The description implies usage context by specifying it loads 'all' tickers for KOSPI and KOSDAQ, suggesting it should be used when a complete reference dataset is needed. However, it doesn't explicitly state when to use alternatives like sibling tools or provide exclusion criteria, leaving some ambiguity about optimal use cases.

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

Install Server

Other Tools

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