Skip to main content
Glama
IQAIcom

Upbit MCP Server

by IQAIcom

GET_ORDERS

Retrieve your orders on Upbit exchange. Filter by market, state, page, and limit to view pending, completed, or canceled orders.

Instructions

List Upbit orders (requires private API)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
marketNo
stateNowait
pageNo
limitNo

Implementation Reference

  • The main handler for the GET_ORDERS tool. It defines the tool object with name, description, parameters, and an execute function that ensures private API access is enabled, builds a query with optional market filter, signs a JWT token, and fetches orders from Upbit's /orders endpoint.
    export const getOrdersTool = {
    	name: "GET_ORDERS",
    	description: "List Upbit orders (requires private API)",
    	parameters: paramsSchema,
    	execute: async ({ market, state, page, limit }: Params) => {
    		ensurePrivateEnabled();
    		const baseURL = `${config.upbit.baseUrl}${config.upbit.apiBasePath}`;
    		const client = createHttpClient(baseURL);
    		const query: Record<string, string> = {
    			state,
    			page: String(page),
    			limit: String(limit),
    		};
    		if (market) query.market = market;
    		const token = signJwtToken(query);
    		const data = await fetchJson<unknown>(client, "/orders", {
    			params: query,
    			headers: { Authorization: `Bearer ${token}` },
    		});
    		return JSON.stringify(data, null, 2);
    	},
    } as const;
  • Zod schema defining input parameters for GET_ORDERS: market (optional string), state (enum: wait/done/cancel, defaults to 'wait'), page (int >=1, defaults to 1), limit (int 1-100, defaults to 100).
    const paramsSchema = z.object({
    	market: z.string().optional(),
    	state: z.enum(["wait", "done", "cancel"]).default("wait"),
    	page: z.number().int().min(1).default(1),
    	limit: z.number().int().min(1).max(100).default(100),
    });
  • src/index.ts:14-36 (registration)
    Import and registration of the getOrdersTool: imported from './tools/get-orders.js' and added to the FastMCP server via server.addTool(getOrdersTool) on line 36.
    import { getOrdersTool } from "./tools/get-orders.js";
    import { getTickerTool } from "./tools/get-ticker.js";
    import { getTradesTool } from "./tools/get-trades.js";
    import { getWithdrawalTool } from "./tools/get-withdrawal.js";
    import { listDepositAddressesTool } from "./tools/list-deposit-addresses.js";
    import { listDepositsTool } from "./tools/list-deposits.js";
    import { listWithdrawalAddressesTool } from "./tools/list-withdrawal-addresses.js";
    import { listWithdrawalsTool } from "./tools/list-withdrawals.js";
    
    async function main() {
    	console.log("Initializing Upbit MCP Server...");
    
    	const server = new FastMCP({
    		name: "Upbit MCP Server",
    		version: "0.0.1",
    	});
    
    	server.addTool(getTickerTool);
    	server.addTool(getOrderbookTool);
    	server.addTool(getTradesTool);
    	server.addTool(getAccountsTool);
    	server.addTool(createOrderTool);
    	server.addTool(getOrdersTool);
  • Helper functions used by the handler: ensurePrivateEnabled() checks that trading is enabled and API keys are configured; signJwtToken() creates a JWT with a query hash for signing Upbit API requests.
    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.",
    		);
    	}
    }
    
    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?

The description only mentions that the tool requires a private API, implying authentication. No annotations are present, so the description should disclose behavioral traits such as pagination, rate limits, or state filtering behavior, which are absent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very brief (one sentence) and front-loaded with the primary action. While concise, it is under-specified for a tool with 4 parameters and no output schema, making it less useful.

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?

Given the complexity (4 parameters, no annotations, no output schema), the description is incomplete. It lacks details on filtering, pagination, and return structure, which are essential for correct usage.

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

Parameters1/5

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

With 0% schema description coverage, the description should explain the parameters (market, state, page, limit). It does not mention any parameter meaning, default values, or usage. The agent must rely solely on the parameter names and enums, which is insufficient.

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 verb 'List' and resource 'Upbit orders', indicating it retrieves a list of orders. It also notes that a private API key is required, which differentiates it from public endpoints. However, it does not specify whether it lists open orders, order history, or all types, which could add clarity.

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 is provided on when to use this tool versus alternatives like GET_ORDER (single order), CANCEL_ORDER, or CREATE_ORDER. There is no mention of use cases, prerequisites, or exclusions.

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