GET_TRADES
Retrieve recent trades for a specified Upbit market to monitor transaction activity and market trends. Input market code (e.g., KRW-BTC) for precise data.
Instructions
Get recent trades for a market
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| market | Yes | Upbit market code, e.g., KRW-BTC |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"market": {
"description": "Upbit market code, e.g., KRW-BTC",
"minLength": 3,
"type": "string"
}
},
"required": [
"market"
],
"type": "object"
}
Implementation Reference
- src/tools/get-trades.ts:15-22 (handler)The execute function that implements the core logic of the GET_TRADES tool, fetching recent trades data from the Upbit API for the specified market.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 parameters for the GET_TRADES tool, specifically the 'market' parameter.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 the getTradesTool with the FastMCP server instance.server.addTool(getTradesTool);