GET_TRADES
Retrieve recent cryptocurrency trade data from Upbit exchange to analyze market activity and transaction patterns for informed trading decisions.
Instructions
Get recent trades for a market
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| market | Yes | Upbit market code, e.g., KRW-BTC |
Implementation Reference
- src/tools/get-trades.ts:15-22 (handler)The main handler function that executes the tool logic: fetches recent trades from Upbit API for the given market and returns formatted JSON.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); },
- src/tools/get-trades.ts:5-7 (schema)Zod schema defining the input parameter 'market' for the tool.const paramsSchema = z.object({ market: z.string().min(3).describe("Upbit market code, e.g., KRW-BTC"), });
- src/index.ts:33-33 (registration)Registers the getTradesTool with the FastMCP server.server.addTool(getTradesTool);
- src/index.ts:16-16 (registration)Imports the getTradesTool from its definition file.import { getTradesTool } from "./tools/get-trades.js";