Skip to main content
Glama
solangii

Upbit MCP Server

create_order

Execute buy or sell orders on the Upbit cryptocurrency exchange. Specify market, order type, and quantity to place limit, market buy, or market sell trades.

Instructions

업비트에 주문을 생성합니다.

Args:
    market (str): 마켓 코드 (예: KRW-BTC)
    side (str): 주문 종류 - bid(매수) 또는 ask(매도)
    ord_type (str): 주문 타입 - limit(지정가), price(시장가 매수), market(시장가 매도)
    volume (str, optional): 주문량 (지정가, 시장가 매도 필수)
    price (str, optional): 주문 가격 (지정가 필수, 시장가 매수 필수)
    
Returns:
    dict: 주문 결과

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
marketYes
sideYes
ord_typeYes
volumeNo
priceNo

Implementation Reference

  • The core handler function implementing the create_order MCP tool. Validates inputs, generates auth token, and POSTs to Upbit API to place orders with support for limit, price, and market types.
    async def create_order(
        market: str, 
        side: Literal["bid", "ask"], 
        ord_type: Literal["limit", "price", "market"],
        volume: Optional[str] = None,
        price: Optional[str] = None,
        ctx: Context = None
    ) -> dict:
        """
        업비트에 주문을 생성합니다.
        
        Args:
            market (str): 마켓 코드 (예: KRW-BTC)
            side (str): 주문 종류 - bid(매수) 또는 ask(매도)
            ord_type (str): 주문 타입 - limit(지정가), price(시장가 매수), market(시장가 매도)
            volume (str, optional): 주문량 (지정가, 시장가 매도 필수)
            price (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 ord_type == "limit" and (not volume or not price):
            if ctx:
                ctx.error("지정가 주문에는 volume과 price가 모두 필요합니다.")
            return {"error": "지정가 주문에는 volume과 price가 모두 필요합니다."}
        
        if ord_type == "price" and not price:
            if ctx:
                ctx.error("시장가 매수 주문에는 price가 필요합니다.")
            return {"error": "시장가 매수 주문에는 price가 필요합니다."}
        
        if ord_type == "market" and not volume:
            if ctx:
                ctx.error("시장가 매도 주문에는 volume이 필요합니다.")
            return {"error": "시장가 매도 주문에는 volume이 필요합니다."}
        
        url = f"{API_BASE}/orders"
        query_params = {
            'market': market,
            'side': side,
            'ord_type': ord_type
        }
        
        if volume:
            query_params['volume'] = volume
        
        if price:
            query_params['price'] = price
        
        headers = {
            "Authorization": f"Bearer {generate_upbit_token(query_params)}"
        }
        
        if ctx:
            ctx.info(f"주문 생성 중: {market} {side} {ord_type}")
        async with httpx.AsyncClient() as client:
            try:
                res = await client.post(url, params=query_params, headers=headers)
                if res.status_code != 201:
                    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:46-46 (registration)
    Registers the create_order function as an MCP tool using the FastMCP decorator.
    mcp.tool()(create_order)
  • main.py:10-10 (registration)
    Imports the create_order handler for registration in the main MCP server.
    from tools.create_order import create_order
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it correctly identifies this as a creation/mutation operation, it provides minimal information about what happens when invoked - no details about authentication requirements, rate limits, error handling, or what constitutes a successful order creation. The return value description ('dict: 주문 결과') is extremely vague.

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 with clear sections (Args, Returns) and efficiently conveys necessary information. While slightly longer than minimal, every sentence adds value given the complex parameter dependencies. The Korean language doesn't affect conciseness scoring as it's appropriately translated and structured.

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?

For a 5-parameter order creation tool with no annotations and no output schema, the description provides adequate but incomplete coverage. The parameter documentation is excellent, but there's insufficient information about the tool's behavior, return format, error conditions, and integration context. The agent would need additional context to use this tool effectively in real trading scenarios.

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?

Given 0% schema description coverage, the description provides excellent parameter semantics. It explains each parameter's purpose, provides examples (KRW-BTC), clarifies enum meanings (bid=매수, ask=매도), and specifies conditional requirements (which parameters are mandatory for which order types). This fully compensates for the lack of schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('create order') and target resource ('Upbit'), distinguishing it from sibling tools like cancel_order or get_orders. It uses a precise verb ('create') and identifies the exact platform where the operation occurs.

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 like cancel_order or get_order. While the purpose is clear, there's no mention of prerequisites, error conditions, or contextual factors that would help an agent decide when this is the appropriate tool to invoke.

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