Skip to main content
Glama
solangii

Upbit MCP Server

cancel_order

Cancel pending orders on the Upbit cryptocurrency exchange by providing the order UUID to manage trades and adjust positions.

Instructions

업비트에서 주문을 취소합니다.

Args:
    uuid (str): 취소할 주문의 UUID
    
Returns:
    dict: 취소 결과

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidYes

Implementation Reference

  • The main handler function that executes the cancel_order tool logic: cancels an Upbit order by UUID using DELETE /order API with authentication.
    async def cancel_order(
        uuid: str,
        ctx: Context = None
    ) -> dict:
        """
        업비트에서 주문을 취소합니다.
        
        Args:
            uuid (str): 취소할 주문의 UUID
            
        Returns:
            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}/order"
        query_params = {'uuid': uuid}
        headers = {
            "Authorization": f"Bearer {generate_upbit_token(query_params)}"
        }
        
        if ctx:
            ctx.info(f"주문 취소 중: {uuid}")
        async with httpx.AsyncClient() as client:
            try:
                res = await client.delete(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:49-49 (registration)
    Registers the cancel_order function as an MCP tool using mcp.tool() decorator.
    mcp.tool()(cancel_order)
  • main.py:13-13 (registration)
    Imports the cancel_order handler function for registration.
    from tools.cancel_order import cancel_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 but offers minimal behavioral insight. It states the tool cancels an order but doesn't disclose critical traits: whether cancellation is immediate or queued, if it requires specific permissions, potential side effects (e.g., partial fills), rate limits, or error responses. The return value is vaguely described as '취소 결과' (cancellation result) without format details.

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 appropriately concise with three sentences: purpose statement, parameter explanation, and return value note. Each sentence adds value, and the structure with 'Args' and 'Returns' sections is clear. However, the Korean-only text might limit accessibility in multilingual contexts.

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?

For a mutation tool (order cancellation) with no annotations and no output schema, the description is insufficient. It lacks details on behavioral implications (e.g., irreversible action, confirmation requirements), error handling, response format, and integration with sibling tools like 'get_order' to verify cancellation. The agent has inadequate context for safe and effective use.

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

Parameters3/5

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

The description explicitly documents the single parameter 'uuid' as '취소할 주문의 UUID' (UUID of the order to cancel), adding meaningful context beyond the schema's 0% coverage. This fully compensates for the schema gap for this one parameter, establishing a clear baseline. No additional parameter insights are needed since there's only one parameter.

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 action ('cancel_order') and target resource ('주문' - order) with specific context ('업비트에서' - on Upbit). It distinguishes from siblings like 'create_order' by specifying cancellation rather than creation. However, it doesn't explicitly differentiate from other potential order modifications beyond the name.

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 prerequisites (e.g., needing an existing order UUID), error conditions, or when other tools like 'get_order' might be needed first. The agent must infer usage from the tool name 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