Skip to main content
Glama
kwonsw812

kiwoom-mcp

by kwonsw812

search_stock

Retrieve stock basic information including name, market classification, industry, and listing date using a 6-digit stock code.

Instructions

종목코드로 종목명, 시장구분, 업종, 상장일 등 종목 기본 정보를 조회합니다

Input Schema

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

Implementation Reference

  • Handler logic for the search_stock tool.
    async ({ stock_code }) => {
      try {
        const data = await client.getStockInfo(stock_code);
        let text = `## 종목 정보\n\n`;
        text += `- 종목코드: ${data.code ?? stock_code}\n`;
        text += `- 종목명: ${data.name ?? "-"}\n`;
        text += `- 시장: ${data.marketName ?? "-"} (${data.marketCode ?? "-"})\n`;
        text += `- 업종: ${data.upName ?? "-"}\n`;
        text += `- 상장일: ${data.regDay ?? "-"}\n`;
        text += `- 전일종가: ${formatCurrency(data.lastPrice ?? "-")}\n`;
        text += `- 상장주식수: ${Number(data.listCount ?? 0).toLocaleString("ko-KR")}주\n`;
        text += `- 종목상태: ${data.state ?? "-"}\n`;
        return textContent(text);
      } catch (error) {
        return errorContent(formatError(error));
      }
    }
  • src/index.ts:598-620 (registration)
    Registration of the search_stock tool.
    server.tool(
      "search_stock",
      "종목코드로 종목명, 시장구분, 업종, 상장일 등 종목 기본 정보를 조회합니다",
      { stock_code: stockCodeSchema },
      { readOnlyHint: true },
      async ({ stock_code }) => {
        try {
          const data = await client.getStockInfo(stock_code);
          let text = `## 종목 정보\n\n`;
          text += `- 종목코드: ${data.code ?? stock_code}\n`;
          text += `- 종목명: ${data.name ?? "-"}\n`;
          text += `- 시장: ${data.marketName ?? "-"} (${data.marketCode ?? "-"})\n`;
          text += `- 업종: ${data.upName ?? "-"}\n`;
          text += `- 상장일: ${data.regDay ?? "-"}\n`;
          text += `- 전일종가: ${formatCurrency(data.lastPrice ?? "-")}\n`;
          text += `- 상장주식수: ${Number(data.listCount ?? 0).toLocaleString("ko-KR")}주\n`;
          text += `- 종목상태: ${data.state ?? "-"}\n`;
          return textContent(text);
        } 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