get_order
Retrieve detailed information about a specific order on Upbit using either the order UUID or a custom identifier. Ideal for tracking and managing cryptocurrency transactions effectively.
Instructions
업비트에서 특정 주문의 정보를 조회합니다.
Args:
uuid (str, optional): 주문 UUID
identifier (str, optional): 조회용 사용자 지정 값
Returns:
dict: 주문 정보
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| identifier | No | ||
| uuid | No |
Implementation Reference
- tools/get_order.py:6-57 (handler)The main handler function implementing the 'get_order' tool. It queries the Upbit API for specific order information using either a UUID or an 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 FastMCP's @mcp.tool() decorator, making it available in the MCP server.mcp.tool()(get_order)
- main.py:12-12 (registration)Import statement for the get_order handler function used in tool registration.from tools.get_order import get_order