Skip to main content
Glama
migusdn

KIS REST API MCP Server

inquery-stock-info

Retrieve daily stock price data from Korea Investment & Securities for specified symbols and date ranges to analyze market trends.

Instructions

Get daily stock price information from Korea Investment & Securities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes
start_dateYes
end_dateYes

Implementation Reference

  • The main asynchronous handler function for the 'inquery-stock-info' tool. It fetches daily stock price information from the Korea Investment & Securities (KIS) API using the provided stock symbol, start date, and end date. Uses httpx for API calls, retrieves auth token, prepares params, and returns the JSON response.
    async def inquery_stock_info(symbol: str, start_date: str, end_date: str):
        """
        Get daily stock price information from Korea Investment & Securities
        
        Args:
            symbol: Stock symbol (e.g. "005930")
            start_date: Start date (YYYYMMDD)
            end_date: End date (YYYYMMDD)
            
        Returns:
            Dictionary containing daily stock price information
        """
        async with httpx.AsyncClient() as client:
            token = await get_access_token(client)
            
            # Prepare request data
            request_data = {
                "FID_COND_MRKT_DIV_CODE": "J",  # 시장구분
                "FID_INPUT_ISCD": symbol,  # 종목코드
                "FID_INPUT_DATE_1": start_date,  # 시작일자
                "FID_INPUT_DATE_2": end_date,  # 종료일자
                "FID_PERIOD_DIV_CODE": "D",  # 기간분류코드
                "FID_ORG_ADJ_PRC": "0",  # 수정주가원구분
            }
            
            response = await client.get(
                f"{TrIdManager.get_domain('stock_info')}{STOCK_INFO_PATH}",
                headers={
                    "content-type": CONTENT_TYPE,
                    "authorization": f"{AUTH_TYPE} {token}",
                    "appkey": os.environ["KIS_APP_KEY"],
                    "appsecret": os.environ["KIS_APP_SECRET"],
                    "tr_id": TrIdManager.get_tr_id("stock_info")
                },
                params=request_data
            )
            
            if response.status_code != 200:
                raise Exception(f"Failed to get stock info: {response.text}")
            
            return response.json()
  • server.py:513-516 (registration)
    The @mcp.tool decorator that registers the 'inquery-stock-info' tool with FastMCP, specifying its name and description.
    @mcp.tool(
        name="inquery-stock-info",
        description="Get daily stock price information from Korea Investment & Securities",
    )
  • API endpoint path constant used by the tool for daily stock price inquiry.
    STOCK_INFO_PATH = "/uapi/domestic-stock/v1/quotations/inquire-daily-price"  # 일별주가조회
  • Transaction ID (TR_ID) for the stock_info operation in the real account TrIdManager.
    "stock_info": "FHKST01010400",  # 일별주가조회
Behavior2/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 states the tool retrieves 'daily stock price information,' implying a read-only operation, but fails to mention critical details like authentication requirements, rate limits, data freshness, or error handling. This leaves significant gaps in understanding how the tool behaves in practice.

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 a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It is front-loaded and appropriately sized for its content, making it easy to parse quickly.

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

Completeness2/5

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

Given the complexity of a financial data tool with 3 required parameters, no annotations, and no output schema, the description is incomplete. It lacks details on parameter semantics, behavioral traits, and expected outputs, leaving the agent with insufficient information to use the tool effectively in context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, meaning parameters are undocumented in the schema. The description does not add any meaning beyond the parameter names (e.g., it doesn't explain what 'symbol' represents, date formats for 'start_date' and 'end_date', or valid ranges). This fails to compensate for the low schema coverage, making parameter understanding inadequate.

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

Purpose4/5

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

The description clearly states the action ('Get daily stock price information') and the resource ('from Korea Investment & Securities'), which is specific and unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'inquery-stock-price' or 'inquery-stock-history', which likely serve similar purposes, preventing a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, such as how it differs from 'inquery-stock-price' or 'inquery-stock-history' among the sibling tools. It lacks any context about use cases, prerequisites, or exclusions, leaving the agent with minimal direction.

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/migusdn/KIS_MCP_Server'

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