Skip to main content
Glama
Juuuuuuni

Stock MCP Server

by Juuuuuuni

search_stock

Find stock ticker codes by entering stock names such as 'Samsung Electronics' or 'Alchera'.

Instructions

종목명으로 종목코드를 검색합니다.

Args: keyword: 검색할 종목명 (예: '삼성전자', '알체라')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The search_stock MCP tool function that searches for Korean stock tickers by company name keyword.
    @mcp.tool()
    def search_stock(keyword: str) -> str:
        """종목명으로 종목코드를 검색합니다.
    
        Args:
            keyword: 검색할 종목명 (예: '삼성전자', '알체라')
        """
        today = datetime.today().strftime("%Y%m%d")
        tickers = stock.get_market_ticker_list(today, market="ALL")
    
        results = []
        for t in tickers:
            name = stock.get_market_ticker_name(t)
            if keyword.lower() in name.lower():
                results.append({"종목코드": t, "종목명": name})
    
        if not results:
            return f"'{keyword}'에 해당하는 종목을 찾을 수 없습니다."
    
        return json.dumps(results[:10], ensure_ascii=False, indent=2)
  • server.py:112-113 (registration)
    The @mcp.tool() decorator registers search_stock as an MCP tool on the FastMCP 'Stock Analyzer' server.
    @mcp.tool()
    def search_stock(keyword: str) -> str:
  • The docstring defines the input schema: keyword (string) is the company name to search for.
    """종목명으로 종목코드를 검색합니다.
    
    Args:
        keyword: 검색할 종목명 (예: '삼성전자', '알체라')
    """
Behavior2/5

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

With no annotations provided, the description carries full burden. It discloses the basic operation but lacks details on error handling, rate limits, or whether it is a read-only operation.

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 very concise, with two sentences and an args block. It is front-loaded and contains no unnecessary information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema, return values need not be explained. However, the description lacks details on search behavior (e.g., partial matches, case sensitivity) and error conditions, making it marginally adequate.

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 description adds necessary meaning for the keyword parameter with examples. It improves understanding beyond the raw schema.

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 tool's function: searching for a stock code by stock name. It provides examples and distinguishes from sibling tools that focus on analysis and screening.

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 description implies usage when needing a stock code from a name, but does not provide explicit guidance on when to use this tool versus alternatives, nor any exclusion criteria.

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/Juuuuuuni/stock-mcp-server'

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