Skip to main content
Glama
IQAIcom

Upbit MCP Server

by IQAIcom

GET_TRADES

Retrieve the most recent trades for a specific Upbit market by providing the market code (e.g., KRW-BTC).

Instructions

Get recent trades for a market

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
marketYesUpbit market code, e.g., KRW-BTC

Implementation Reference

  • The GET_TRADES tool definition and execute handler. Makes a GET request to /trades/ticks on the Upbit API and returns the recent trades data for a given market.
    export const getTradesTool = {
    	name: "GET_TRADES",
    	description: "Get recent trades for a market",
    	parameters: paramsSchema,
    	execute: async ({ market }: Params) => {
    		const baseURL = `${config.upbit.baseUrl}${config.upbit.apiBasePath}`;
    		const client = createHttpClient(baseURL);
    		const data = await fetchJson<unknown>(client, "/trades/ticks", {
    			params: { market },
    		});
    		return JSON.stringify(data, null, 2);
    	},
  • Input validation schema requiring 'market' (string, min 3 chars, e.g., KRW-BTC).
    const paramsSchema = z.object({
    	market: z.string().min(3).describe("Upbit market code, e.g., KRW-BTC"),
    });
  • src/index.ts:33-33 (registration)
    Registration of getTradesTool via server.addTool() in main()
    server.addTool(getTradesTool);
  • createHttpClient helper used by the handler to build the Axios HTTP client
    export function createHttpClient(baseURL?: string): AxiosInstance {
    	const client = axios.create({ baseURL, timeout: 15_000 });
    
    	axiosRetry(client, {
    		retries: 3,
    		retryDelay: axiosRetry.exponentialDelay,
    		retryCondition: (error) => {
    			if (axiosRetry.isNetworkOrIdempotentRequestError(error)) return true;
    			const status = error.response?.status ?? 0;
    			return status === 429 || (status >= 500 && status < 600);
    		},
    	});
    
    	return client;
    }
  • fetchJson helper used by the handler to execute the GET request and parse the response
    export async function fetchJson<T>(
    	client: AxiosInstance,
    	url: string,
    	options: {
    		method?: "GET" | "POST" | "DELETE" | "PUT" | "PATCH";
    		params?: Record<string, unknown>;
    		data?: unknown;
    		headers?: Record<string, string>;
    	} = {},
    	schema?: z.ZodType<T>,
    ): Promise<T> {
    	try {
    		const response = await client.request({
    			url,
    			method: options.method ?? "GET",
    			params: options.params,
    			data: options.data,
    			headers: options.headers,
    		});
    
    		const data = response.data;
    		if (schema) {
    			return schema.parse(data);
    		}
    		return data as T;
    	} catch (err) {
    		if (axios.isAxiosError(err)) {
    			const ae = err as AxiosError;
    			const status = ae.response?.status ?? 0;
    			const message = ae.message || "HTTP request failed";
    			const data = ae.response?.data;
    			throw new HttpError(status, message, data);
    		}
    		throw err;
    	}
    }
Behavior1/5

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

No annotations provided, and the description does not disclose any behavioral traits such as pagination, recency limits, or rate limiting. The agent has no information about side effects or constraints.

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 concise but lacks sufficient detail to be fully effective. It is front-loaded but does not earn its place by adding value beyond the bare minimum.

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 simplicity of the tool (single required parameter, no output schema), the description is minimally complete. It lacks details on output format, pagination, and fields returned, which are important for a trading data tool.

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?

Schema coverage is 100% with a clear description for the market parameter. The tool description adds no additional meaning beyond the schema, so baseline score of 3 is appropriate.

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 'Get' and resource 'recent trades for a market'. It distinguishes from siblings like GET_ORDERBOOK and GET_TICKER by specifying trades rather than order book or ticker. However, it could be more specific about the scope (e.g., public market data vs user-specific).

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 this tool versus alternatives like GET_TICKER or GET_ORDERBOOK. Lacks context for when it is appropriate or any prerequisites.

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