Skip to main content
Glama
migusdn

KIS REST API MCP Server

inquery-stock-info

Retrieve daily stock price data for specified Korean securities using KIS REST API. Input symbol, start date, and end date to access accurate stock information.

Instructions

Get daily stock price information from Korea Investment & Securities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
end_dateYes
start_dateYes
symbolYes

Implementation Reference

  • Full handler function for 'inquery-stock-info' tool: registers the tool with MCP, defines input parameters (symbol, start_date, end_date), fetches daily stock price data via KIS API using prepared params, authentication token, and specific TR_ID/path.
    @mcp.tool( name="inquery-stock-info", description="Get daily stock price information from Korea Investment & Securities", ) 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)
    MCP tool registration decorator specifying the tool name 'inquery-stock-info' and description.
    @mcp.tool( name="inquery-stock-info", description="Get daily stock price information from Korea Investment & Securities", )
  • Input schema defined by function parameters (symbol: str, start_date: str, end_date: str) and docstring describing args and return type (dict from API).
    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

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