inquery-overseas-stock-price
Retrieve current overseas stock prices through Korea Investment & Securities, providing real-time market data for international trading decisions.
Instructions
Get overseas stock price from Korea Investment & Securities
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | ||
| market | Yes |
Implementation Reference
- server.py:727-765 (handler)The main handler function for the 'inquery-overseas-stock-price' tool. It is decorated with @mcp.tool which registers it with the given name. Fetches the current price of an overseas stock using the Korea Investment & Securities (KIS) API by making an authenticated GET request to the overseas stock price endpoint.@mcp.tool( name="inquery-overseas-stock-price", description="Get overseas stock price from Korea Investment & Securities", ) async def inquery_overseas_stock_price(symbol: str, market: str): """ Get overseas stock price Args: symbol: Stock symbol (e.g. "AAPL") market: Market code ("NASD" for NASDAQ, "NYSE" for NYSE, etc.) Returns: Dictionary containing stock price information """ async with httpx.AsyncClient() as client: token = await get_access_token(client) response = await client.get( f"{TrIdManager.get_domain('buy')}{OVERSEAS_STOCK_PRICE_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": "HHDFS00000300" }, params={ "AUTH": "", "EXCD": market, "SYMB": symbol } ) if response.status_code != 200: raise Exception(f"Failed to get overseas stock price: {response.text}") return response.json()