Skip to main content
Glama
kwonsw812

kiwoom-mcp

by kwonsw812

get_trade_history

Retrieve daily or specific date trade records including buy/sell transactions and profit/loss details for Kiwoom Securities accounts, covering up to the past two months.

Instructions

당일 또는 특정 날짜의 매매일지(매수/매도 내역, 손익)를 조회합니다 (최근 2개월까지)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
base_dateNo조회일자 (미입력시 오늘) (YYYYMMDD 형식)
account_noNo계좌번호 (미입력시 기본 계좌 사용)

Implementation Reference

  • The underlying implementation of the trade history request logic.
    async getTradeHistory(accountNo: string, baseDate?: string) {
      return this.request("/api/dostk/acnt", "ka10170", {
        acc_no: accountNo,
        base_dt: baseDate ?? today(),
        ottks_tp: "2",
        ch_crd_tp: "0",
      });
    }
  • src/index.ts:640-657 (registration)
    MCP tool registration for 'get_trade_history', which calls the handler.
    server.tool(
      "get_trade_history",
      "당일 또는 특정 날짜의 매매일지(매수/매도 내역, 손익)를 조회합니다 (최근 2개월까지)",
      {
        base_date: dateSchema("조회일자 (미입력시 오늘)").optional(),
        account_no: accountNoSchema,
      },
      { readOnlyHint: true },
      async ({ base_date, account_no }) => {
        try {
          const acct = resolveAccountNo(account_no);
          const data = await client.getTradeHistory(acct, base_date);
          return textContent(formatTradeHistory(data));
        } 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