Skip to main content
Glama
solangii

Upbit MCP Server

get_orders

Retrieve order history from Upbit cryptocurrency exchange. Filter orders by market, status, and pagination to manage trading activities.

Instructions

업비트에서 주문 내역을 조회합니다.

Args:
    market (str, optional): 마켓 코드 (예: KRW-BTC)
    state (str): 주문 상태 - wait(대기), done(완료), cancel(취소)
    page (int): 페이지 번호
    limit (int): 페이지당 주문 개수 (최대 100)
    
Returns:
    list[dict]: 주문 내역

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
marketNo
stateNowait
pageNo
limitNo

Implementation Reference

  • The main asynchronous handler function for the 'get_orders' tool. It fetches order history from the Upbit API using provided parameters like market, state, page, and limit. Includes input validation via type hints, error handling, and logging via context.
    async def get_orders(
        market: Optional[str] = None,
        state: Literal["wait", "done", "cancel"] = "wait",
        page: int = 1,
        limit: int = 100,
        ctx: Context = None
    ) -> list[dict]:
        """
        업비트에서 주문 내역을 조회합니다.
        
        Args:
            market (str, optional): 마켓 코드 (예: KRW-BTC)
            state (str): 주문 상태 - wait(대기), done(완료), cancel(취소)
            page (int): 페이지 번호
            limit (int): 페이지당 주문 개수 (최대 100)
            
        Returns:
            list[dict]: 주문 내역
        """
        if not UPBIT_ACCESS_KEY:
            if ctx:
                ctx.error("API 키가 설정되지 않았습니다. .env 파일에 UPBIT_ACCESS_KEY와 UPBIT_SECRET_KEY를 설정해주세요.")
            return [{"error": "API 키가 설정되지 않았습니다."}]
        
        url = f"{API_BASE}/orders"
        query_params = {
            'state': state,
            'page': str(page),
            'limit': str(limit)
        }
        
        if market:
            query_params['market'] = market
        
        headers = {
            "Authorization": f"Bearer {generate_upbit_token(query_params)}"
        }
        
        if ctx:
            ctx.info(f"주문 내역 조회 중: 상태={state}")
        async with httpx.AsyncClient() as client:
            try:
                res = await client.get(url, params=query_params, headers=headers)
                if res.status_code != 200:
                    if ctx:
                        ctx.error(f"업비트 API 오류: {res.status_code} - {res.text}")
                    return [{"error": f"업비트 API 오류: {res.status_code}"}]
                return res.json()
            except Exception as e:
                if ctx:
                    ctx.error(f"API 호출 중 오류 발생: {str(e)}")
                return [{"error": f"API 호출 중 오류 발생: {str(e)}"}]
  • main.py:47-47 (registration)
    Registers the get_orders function as an MCP tool using the FastMCP tool decorator.
    mcp.tool()(get_orders)
  • main.py:11-11 (registration)
    Imports the get_orders handler function for registration.
    from tools.get_orders import get_orders
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It implies a read-only operation ('조회합니다' - retrieve) and mentions pagination via 'page' and 'limit', which adds useful context. However, it lacks details on authentication requirements, rate limits, error handling, or response structure beyond 'list[dict]', leaving gaps for a tool with 4 parameters.

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 well-structured and appropriately sized. It starts with a clear purpose statement, followed by organized sections for 'Args' and 'Returns', with bullet-like formatting. Every sentence adds value, though the Korean-only text might limit accessibility for non-Korean agents, slightly reducing efficiency.

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 no annotations and no output schema, the description is moderately complete. It covers the purpose and parameters well but lacks details on authentication, error cases, or the structure of the returned 'list[dict]'. For a tool with 4 parameters and no structured safety hints, more behavioral context would improve completeness, though it meets a baseline for a read operation.

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

Parameters5/5

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

The description adds significant semantic value beyond the input schema, which has 0% description coverage. It explains each parameter in Korean with examples ('예: KRW-BTC'), clarifies 'state' options (wait, done, cancel), and specifies constraints like '최대 100' (maximum 100) for 'limit'. This fully compensates for the schema's lack of descriptions, making parameters clear and actionable.

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: '업비트에서 주문 내역을 조회합니다' (Retrieves order history from Upbit). It specifies the verb '조회합니다' (retrieve/query) and resource '주문 내역' (order history), which is specific and actionable. However, it doesn't explicitly differentiate from sibling tools like 'get_order' (singular) or 'get_trades', leaving some ambiguity about scope.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_order' (for a single order) or 'get_trades' (for trade history), nor does it specify prerequisites or contexts where this tool is preferred. The agent must infer usage from the tool name and parameters 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/solangii/upbit-mcp-server'

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