Skip to main content
Glama
kwonsw812

kiwoom-mcp

by kwonsw812

search_stock

Read-only

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));
        }
      }
    );
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations provide readOnlyHint=true, indicating a safe read operation. The description adds context about what information is retrieved (name, market, industry, listing date), which is useful beyond annotations. However, it doesn't disclose behavioral traits like rate limits, authentication needs, or response format details, leaving some gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Korean that directly states the tool's function. It's front-loaded with the core purpose and lists key data points without unnecessary elaboration. However, it could be slightly more structured for clarity in English contexts.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (1 parameter, read-only, no output schema), the description is adequate but minimal. It covers the basic purpose and data retrieved, but lacks details on output format, error handling, or integration with sibling tools, leaving room for improvement in completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the parameter 'stock_code' fully documented in the schema (type, pattern, example). The description doesn't add any parameter-specific details beyond what the schema provides, so it meets the baseline for high coverage without extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: '조회합니다' (to retrieve) basic stock information by stock code, specifying the resource (stock basic information) and key data points (name, market classification, industry, listing date). It distinguishes from siblings like get_stock_price (price only) or get_stock_chart (chart data), but doesn't explicitly name alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context: when you need basic stock info by code. However, it doesn't explicitly state when to use this versus alternatives (e.g., get_stock_price for price, get_stock_chart for charts) or any prerequisites. The guidance is implied but not detailed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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