Skip to main content
Glama
IQAIcom

Upbit MCP Server

by IQAIcom

CANCEL_ORDER

Cancel an existing order on Upbit by providing its UUID. Requires private API authentication.

Instructions

Cancel an existing Upbit order (requires private API)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidYes

Implementation Reference

  • The cancelOrderTool object with name 'CANCEL_ORDER', description, params schema, and execute handler that cancels an Upbit order via DELETE request.
    export const cancelOrderTool = {
    	name: "CANCEL_ORDER",
    	description: "Cancel an existing Upbit order (requires private API)",
    	parameters: paramsSchema,
    	execute: async ({ uuid }: Params) => {
    		ensurePrivateEnabled();
    		const baseURL = `${config.upbit.baseUrl}${config.upbit.apiBasePath}`;
    		const client = createHttpClient(baseURL);
    		const query = { uuid };
    		const token = signJwtToken(query);
    		const data = await fetchJson<unknown>(client, "/order", {
    			method: "DELETE",
    			params: query,
    			headers: { Authorization: `Bearer ${token}` },
    		});
    		return JSON.stringify(data, null, 2);
    	},
    } as const;
  • Zod schema for CANCEL_ORDER input: requires a 'uuid' string (min length 1).
    const paramsSchema = z.object({
    	uuid: z.string().min(1),
    });
  • src/index.ts:38-38 (registration)
    Registration of cancelOrderTool on the FastMCP server at line 38.
    server.addTool(cancelOrderTool);
  • ensurePrivateEnabled helper called before executing the cancel order.
    export function ensurePrivateEnabled(): void {
    	if (!config.upbit.enablePrivate) {
    		throw new Error(
    			"Private trading tools are disabled. Set UPBIT_ENABLE_TRADING=true to enable.",
    		);
    	}
    	if (!config.upbit.accessKey || !config.upbit.secretKey) {
    		throw new Error(
    			"Upbit API keys are not configured. Set UPBIT_ACCESS_KEY and UPBIT_SECRET_KEY.",
    		);
    	}
    }
  • signJwtToken helper used to sign the JWT for authenticating the DELETE request.
    export function signJwtToken(
    	params?: Record<string, string | number | boolean | undefined>,
    ): string {
    	const payload: Record<string, unknown> = {
    		access_key: config.upbit.accessKey,
    		nonce: crypto.randomUUID(),
    	};
    
    	if (params && Object.keys(params).length > 0) {
    		const searchParams = new URLSearchParams();
    		const sortedKeys = Object.keys(params).sort();
    		for (const key of sortedKeys) {
    			const value = params[key];
    			if (value === undefined) continue;
    			searchParams.append(key, String(value));
    		}
    		const encoded = searchParams.toString();
    		const queryHash = crypto.createHash("sha512").update(encoded).digest("hex");
    		payload.query_hash = queryHash;
    		payload.query_hash_alg = "SHA512";
    	}
    
    	return jwt.sign(payload, config.upbit.secretKey as string);
    }
Behavior2/5

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

Only mentions 'requires private API'. No disclosure of effects (e.g., irreversible, potential fees, or status changes). With no annotations, more detail is needed.

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?

Single sentence is efficient and front-loaded. Could include more detail without being verbose, but still concise.

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?

Adequate for a simple tool with one parameter and no output schema, but lacks behavioral and usage context. Cannot fully compensate for missing annotations.

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

Parameters2/5

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

Schema has 0% description coverage. The description does not explain that 'uuid' is the order identifier. While inferable, it adds no value beyond the schema definition.

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?

Clearly states the verb 'Cancel' and resource 'existing Upbit order', distinguishing it from siblings like CREATE_ORDER and GET_ORDER.

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?

No guidance on when to use or alternatives. Does not mention prerequisites like order state (e.g., must not be already canceled) or context for when cancellation is appropriate.

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/IQAIcom/mcp-upbit'

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