Skip to main content
Glama
migusdn

KIS REST API MCP Server

inquery-overseas-stock-price

Retrieve overseas stock prices using KIS REST API MCP Server, enabling users to query real-time data by specifying a stock symbol and market.

Instructions

Get overseas stock price from Korea Investment & Securities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
marketYes
symbolYes

Implementation Reference

  • The primary handler function decorated with @mcp.tool decorator, which registers the tool and defines its schema via parameters and description. It fetches the current overseas stock price using the KIS API.
    @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()
  • server.py:727-730 (registration)
    The @mcp.tool decorator registers the 'inquery-overseas-stock-price' tool with MCP server.
    @mcp.tool( name="inquery-overseas-stock-price", description="Get overseas stock price from Korea Investment & Securities", )
  • API endpoint path constant used by the tool.
    OVERSEAS_STOCK_PRICE_PATH = "/uapi/overseas-price/v1/quotations/price"
  • Hardcoded TR_ID for overseas stock price inquiry.
    "tr_id": "HHDFS00000300"

Other Tools

Related 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