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
| Name | Required | Description | Default |
|---|---|---|---|
| stock_code | Yes | 종목코드 (예: 005930) |
Implementation Reference
- src/index.ts:562-576 (handler)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)); } } ); - src/index.ts:177-183 (handler)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, }); } - src/index.ts:26-29 (schema)Schema definition for stock_code input.
const stockCodeSchema = z .string() .regex(/^\d{6}$/, "종목코드는 6자리 숫자여야 합니다") .describe("종목코드 (예: 005930)");