Skip to main content
Glama

CREATE_ORDER

Execute buy or sell orders on the Upbit cryptocurrency exchange using private API credentials. Specify market, order type, volume, and price parameters to place trades programmatically.

Instructions

Create an Upbit order (requires private API)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
marketYes
sideYes
ord_typeYes
volumeNo
priceNo
time_in_forceNo
smp_typeNo
identifierNo

Implementation Reference

  • The createOrderTool object defining the CREATE_ORDER tool, including name, description, parameters schema reference, and the execute handler function that performs the order creation via Upbit's private API.
    export const createOrderTool = { name: "CREATE_ORDER", description: "Create an Upbit order (requires private API)", parameters: paramsSchema, execute: async ({ market, side, ord_type, volume, price, time_in_force, smp_type, identifier, }: Params) => { ensurePrivateEnabled(); const baseURL = `${config.upbit.baseUrl}${config.upbit.apiBasePath}`; const client = createHttpClient(baseURL); const body = { market, side, ord_type, volume, price, time_in_force, smp_type, identifier, }; const token = signJwtToken(body); const data = await fetchJson<unknown>(client, "/orders", { method: "POST", data: body, headers: { Authorization: `Bearer ${token}` }, }); return JSON.stringify(data, null, 2); }, } as const;
  • Zod schema (paramsSchema) for validating input parameters to the CREATE_ORDER tool, including refinements for different order types.
    const paramsSchema = z .object({ market: z.string(), side: z.enum(["bid", "ask"]), ord_type: z.enum(["limit", "price", "market"]), volume: z.string().optional(), price: z.string().optional(), time_in_force: z.enum(["ioc", "fok", "post_only"]).optional(), smp_type: z.enum(["cancel_maker", "cancel_taker", "reduce"]).optional(), identifier: z.string().optional(), }) .refine((p) => (p.ord_type === "limit" ? p.volume && p.price : true), { message: "Limit orders require both volume and price", }) .refine((p) => (p.ord_type === "price" ? !!p.price : true), { message: "Market buy (price) requires price", }) .refine((p) => (p.ord_type === "market" ? !!p.volume : true), { message: "Market sell (market) requires volume", }) .refine((p) => !(p.time_in_force === "post_only" && p.smp_type), { message: "post_only cannot be used with smp_type", });
  • src/index.ts:35-35 (registration)
    Registers the createOrderTool with the FastMCP server instance.
    server.addTool(createOrderTool);

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