Skip to main content
Glama
migusdn

KIS REST API MCP Server

inquery-order-list

Retrieve daily order lists from Korea Investment & Securities for specified date ranges to track trading activity and manage investment portfolios.

Instructions

Get daily order list from Korea Investment & Securities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateYes
end_dateYes

Implementation Reference

  • The main handler function for the 'inquery-order-list' tool. It authenticates with the Korea Investment & Securities API, prepares request parameters for the order list query between start_date and end_date, sends a GET request, and returns the JSON response.
    async def inquery_order_list(start_date: str, end_date: str):
        """
        Get daily order list from Korea Investment & Securities
        
        Args:
            start_date: Start date (YYYYMMDD)
            end_date: End date (YYYYMMDD)
            
        Returns:
            Dictionary containing order list information
        """
        async with httpx.AsyncClient() as client:
            token = await get_access_token(client)
            
            # Prepare request data
            request_data = {
                "CANO": os.environ["KIS_CANO"],  # 계좌번호
                "ACNT_PRDT_CD": "01",  # 계좌상품코드
                "INQR_STRT_DT": start_date,  # 조회시작일자
                "INQR_END_DT": end_date,  # 조회종료일자
                "SLL_BUY_DVSN_CD": "00",  # 매도매수구분
                "INQR_DVSN": "00",  # 조회구분
                "PDNO": "",  # 종목코드
                "CCLD_DVSN": "00",  # 체결구분
                "ORD_GNO_BRNO": "",  # 주문채번지점번호
                "ODNO": "",  # 주문번호
                "INQR_DVSN_3": "00",  # 조회구분3
                "INQR_DVSN_1": "",  # 조회구분1
                "CTX_AREA_FK100": "",  # 연속조회검색조건100
                "CTX_AREA_NK100": "",  # 연속조회키100
            }
            
            response = await client.get(
                f"{TrIdManager.get_domain('order_list')}{ORDER_LIST_PATH}",
                headers={
                    "content-type": CONTENT_TYPE,
                    "authorization": f"{AUTH_TYPE} {token}",
                    "appkey": os.environ["KIS_APP_KEY"],
                    "appsecret": os.environ["KIS_APP_SECRET"],
                    "tr_id": TrIdManager.get_tr_id("order_list")
                },
                params=request_data
            )
            
            if response.status_code != 200:
                raise Exception(f"Failed to get order list: {response.text}")
            
            return response.json()
  • server.py:407-410 (registration)
    Registers the tool with MCP framework using the @mcp.tool decorator, specifying the name and description.
    @mcp.tool(
        name="inquery-order-list",
        description="Get daily order list from Korea Investment & Securities",
    )
  • Input schema defined by function parameters (start_date: str, end_date: str) and docstring describing expected formats (YYYYMMDD) and return type.
    async def inquery_order_list(start_date: str, end_date: str):
        """
        Get daily order list from Korea Investment & Securities
        
        Args:
            start_date: Start date (YYYYMMDD)
            end_date: End date (YYYYMMDD)
            
        Returns:
            Dictionary containing order list information
        """
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Get' implying a read operation, but doesn't disclose behavioral traits such as authentication needs, rate limits, pagination, or response format. For a financial data tool with no annotations, this is a significant gap in transparency about how the tool behaves and any constraints.

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 that front-loads the core purpose ('Get daily order list') and specifies the source. There is zero waste or redundancy, making it highly concise and well-structured for quick understanding.

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

Completeness2/5

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

Given the tool's complexity (financial data retrieval with date parameters), lack of annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't cover authentication, error handling, return values, or how to interpret results, leaving critical gaps for an AI agent to use the tool effectively in a real-world context.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It mentions 'daily order list' which implies date-based filtering, aligning with the 'start_date' and 'end_date' parameters. However, it doesn't add meaning beyond this implication—no details on date format, timezone, or what 'daily' entails (e.g., if it aggregates by day). With two undocumented parameters, the description provides minimal semantic 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 verb ('Get') and resource ('daily order list'), specifying the source ('from Korea Investment & Securities'). It distinguishes from siblings like 'inquery-balance' or 'inquery-order-detail' by focusing on daily order lists rather than balances or detailed orders. However, it doesn't explicitly differentiate from 'order-stock' or 'order-overseas-stock', which might be related write operations.

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool versus alternatives like 'inquery-order-detail' for specific orders or 'inquery-balance' for account balances. The description implies usage for retrieving daily order lists, but lacks context on prerequisites, exclusions, or comparisons to sibling tools, leaving the agent to infer based on tool names alone.

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/migusdn/KIS_MCP_Server'

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