Skip to main content
Glama
solangii

Upbit MCP Server

get_order

Retrieve detailed information about a specific order on the Upbit cryptocurrency exchange using its UUID or custom identifier.

Instructions

업비트에서 특정 주문의 정보를 조회합니다.

Args:
    uuid (str, optional): 주문 UUID
    identifier (str, optional): 조회용 사용자 지정 값
    
Returns:
    dict: 주문 정보

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidNo
identifierNo

Implementation Reference

  • The main handler function implementing the 'get_order' tool. It queries the Upbit API for order information using either a UUID or identifier, handles authentication, errors, and returns the order details as a dictionary.
    async def get_order(
        uuid: Optional[str] = None,
        identifier: Optional[str] = None,
        ctx: Context = None
    ) -> dict:
        """
        업비트에서 특정 주문의 정보를 조회합니다.
        
        Args:
            uuid (str, optional): 주문 UUID
            identifier (str, optional): 조회용 사용자 지정 값
            
        Returns:
            dict: 주문 정보
        """
        if not UPBIT_ACCESS_KEY:
            if ctx:
                ctx.error("API 키가 설정되지 않았습니다. .env 파일에 UPBIT_ACCESS_KEY와 UPBIT_SECRET_KEY를 설정해주세요.")
            return {"error": "API 키가 설정되지 않았습니다."}
        
        if not uuid and not identifier:
            if ctx:
                ctx.error("uuid 또는 identifier 중 하나는 필수입니다.")
            return {"error": "uuid 또는 identifier 중 하나는 필수입니다."}
        
        url = f"{API_BASE}/order"
        query_params = {}
        
        if uuid:
            query_params['uuid'] = uuid
        
        if identifier:
            query_params['identifier'] = identifier
        
        headers = {
            "Authorization": f"Bearer {generate_upbit_token(query_params)}"
        }
        
        if ctx:
            ctx.info(f"주문 정보 조회 중: {uuid or identifier}")
        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:48-48 (registration)
    Registration of the 'get_order' tool using the FastMCP decorator mcp.tool().
    mcp.tool()(get_order)
  • main.py:12-12 (registration)
    Import statement for the get_order handler function, necessary for registration.
    from tools.get_order import get_order

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