Skip to main content
Glama
kwonsw812

kiwoom-mcp

by kwonsw812

get_stock_price

Read-only

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)");
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 value by specifying the exact metrics returned (current price, PER, etc.), which goes beyond the annotation. However, it doesn't mention rate limits, authentication needs, or response format details.

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

Conciseness5/5

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

The description is a single, efficient sentence in Korean that lists all key data points without unnecessary words. It's front-loaded with the core purpose and provides complete information in minimal space.

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

Completeness4/5

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

For a read-only tool with one well-documented parameter and no output schema, the description effectively covers what data is returned. It could be more complete by specifying the return format or units (e.g., currency), but given the annotations and simple schema, it's largely adequate.

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 (including pattern and example). The description doesn't add any parameter-specific information beyond what's in the schema, so it meets the baseline for high schema coverage.

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

Purpose5/5

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

The description clearly states the specific action ('조회합니다' - 'retrieves' or 'queries') and lists the exact data points returned (current price, day-over-day change, open/high/low prices, 250-day high/low, PER/PBR/EPS). It distinguishes from siblings like get_stock_chart (visual data) or search_stock (finding stocks).

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 for retrieving detailed stock price metrics, but doesn't explicitly state when to use this versus alternatives like get_stock_chart (for chart data) or search_stock (for finding stocks by name). No explicit exclusions or prerequisites are mentioned.

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