Skip to main content
Glama
kwonsw812

kiwoom-mcp

by kwonsw812

get_stock_chart

Retrieve daily OHLCV chart data for Korean stocks by stock code and date, displaying recent data first for analysis.

Instructions

기준일자 기준 일봉 OHLCV 차트 데이터를 조회합니다 (최근 데이터부터 내림차순)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stock_codeYes종목코드 (예: 005930)
base_dateNo기준일자 (이 날짜 이전 데이터 조회) (YYYYMMDD 형식)

Implementation Reference

  • The underlying method that performs the API request to fetch stock chart data.
    async getStockChart(stockCode: string, baseDate: string) {
      return this.request("/api/dostk/chart", "ka10081", {
        stk_cd: stockCode,
        base_dt: baseDate,
        upd_stkpc_tp: "1",
      });
    }
  • src/index.ts:578-595 (registration)
    The MCP tool definition and handler logic for "get_stock_chart".
    // 5. get_stock_chart - 일봉 차트 (ka10081)
    server.tool(
      "get_stock_chart",
      "기준일자 기준 일봉 OHLCV 차트 데이터를 조회합니다 (최근 데이터부터 내림차순)",
      {
        stock_code: stockCodeSchema,
        base_date: dateSchema("기준일자 (이 날짜 이전 데이터 조회)").optional(),
      },
      { readOnlyHint: true },
      async ({ stock_code, base_date }) => {
        try {
          const data = await client.getStockChart(stock_code, base_date ?? today());
          return textContent(formatChartData(data));
        } catch (error) {
          return errorContent(formatError(error));
        }
      }
    );

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/kwonsw812/kiwoom-mcp'

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