Skip to main content
Glama
IQAIcom

Upbit MCP Server

by IQAIcom

GET_ACCOUNTS

Retrieve your Upbit account balances to view holdings across all assets. Requires private API access enabled.

Instructions

Get Upbit account balances (requires private API enabled)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The execute function that calls Upbit /accounts API via authenticated HTTP request and returns JSON-formatted account balances.
    	execute: async () => {
    		ensurePrivateEnabled();
    		const baseURL = `${config.upbit.baseUrl}${config.upbit.apiBasePath}`;
    		const client = createHttpClient(baseURL);
    		const token = signJwtToken();
    		const data = await fetchJson<unknown>(client, "/accounts", {
    			headers: { Authorization: `Bearer ${token}` },
    		});
    		return JSON.stringify(data, null, 2);
    	},
    } as const;
  • Empty Zod schema — the GET_ACCOUNTS tool takes no parameters.
    parameters: z.object({}),
  • src/index.ts:34-34 (registration)
    Registration of getAccountsTool on the FastMCP server at startup.
    server.addTool(getAccountsTool);
  • Validates that private API access is enabled and API keys are configured before making the request.
    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.",
    		);
    	}
    }
  • Generates a JWT token signed with the Upbit secret key for API authentication.
    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);
    }
Behavior3/5

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

No annotations are provided, so the description carries full burden. It discloses the requirement for private API access, but does not mention other behavioral traits like rate limits, data freshness, or error handling. The read-only nature is implied but not explicit.

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

Conciseness5/5

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

The description is a single, front-loaded sentence with no unnecessary words. It delivers the essential information efficiently.

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?

For a simple tool with no parameters and no output schema, the description explains the purpose but does not specify the return format or structure. The agent may need additional context to interpret the response.

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

Parameters4/5

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

The tool has zero parameters, and schema coverage is 100% trivially. The description adds no parameter details because none are needed. Baseline 4 is appropriate.

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?

Description clearly states the verb 'Get' and resource 'account balances' for the Upbit platform. It distinguishes from sibling tools like GET_TICKER or GET_ORDERBOOK, which deal with market data, not account balances.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Includes the prerequisite 'requires private API enabled', which guides when the tool can be used. However, it does not explicitly state when to use this tool versus alternatives, though no direct alternatives exist among siblings.

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