Skip to main content
Glama
kwonsw812

kiwoom-mcp

by kwonsw812

get_stock_price

Retrieve current stock prices with key financial metrics including daily changes, price ranges, and valuation ratios like PER/PBR/EPS for informed trading decisions.

Instructions

종목의 현재가, 전일대비, 시가/고가/저가, 250일 고저, PER/PBR/EPS를 조회합니다

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stock_codeYes종목코드 (예: 005930)

Implementation Reference

  • The handler registration for "get_stock_price". It calls client.getStockPrice and formats the result.
    // 4. get_stock_price - 주식 현재가 (ka10001)
    server.tool(
      "get_stock_price",
      "종목의 현재가, 전일대비, 시가/고가/저가, 250일 고저, PER/PBR/EPS를 조회합니다",
      { stock_code: stockCodeSchema },
      { readOnlyHint: true },
      async ({ stock_code }) => {
        try {
          const data = await client.getStockPrice(stock_code);
          return textContent(formatStockPrice(data));
        } catch (error) {
          return errorContent(formatError(error));
        }
      }
    );
  • The underlying API client method that performs the request for "get_stock_price".
    // 주식기본정보요청 (ka10001)
    // URL: /api/dostk/stkinfo | 필수: stk_cd
    async getStockPrice(stockCode: string) {
      return this.request("/api/dostk/stkinfo", "ka10001", {
        stk_cd: stockCode,
      });
    }
  • Schema definition for stock_code input.
    const stockCodeSchema = z
      .string()
      .regex(/^\d{6}$/, "종목코드는 6자리 숫자여야 합니다")
      .describe("종목코드 (예: 005930)");

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