GET_TICKER
Retrieve current market price and trading data for a specific cryptocurrency pair on Upbit exchange to monitor real-time market conditions.
Instructions
Get the latest ticker data from Upbit for a single market
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| market | Yes | Upbit market code, e.g., KRW-BTC |
Implementation Reference
- src/tools/get-ticker.ts:16-24 (handler)The execute function that handles the tool logic: fetches the latest ticker data from Upbit API for the given market and returns it as formatted JSON.execute: async ({ market }: Params) => { const baseURL = `${config.upbit.baseUrl}${config.upbit.apiBasePath}`; const client = createHttpClient(baseURL); const data = await fetchJson<unknown>(client, "/ticker", { params: { markets: market }, }); const item = Array.isArray(data) ? (data as any[])[0] : (data as any); return JSON.stringify(item, null, 2); },
- src/tools/get-ticker.ts:6-8 (schema)Zod schema defining the input parameter 'market' for the GET_TICKER tool.const paramsSchema = z.object({ market: z.string().min(3).describe("Upbit market code, e.g., KRW-BTC"), });
- src/index.ts:31-31 (registration)Registers the getTickerTool with the FastMCP server.server.addTool(getTickerTool);