Skip to main content
Glama

GET_TICKER

Retrieve real-time ticker data for a specific cryptocurrency market on Upbit using the market code, such as KRW-BTC, enabling users to monitor current price and trading details.

Instructions

Get the latest ticker data from Upbit for a single market

Input Schema

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

Implementation Reference

  • The execute function that implements the core logic of the GET_TICKER tool: fetches ticker data from Upbit API using the provided market parameter 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, "/ticker", { params: { markets: market }, }); const item = Array.isArray(data) ? (data as any[])[0] : (data as any); return JSON.stringify(item, null, 2); },
  • Zod schema defining the input parameters for the GET_TICKER tool (market string). This is referenced in the tool's parameters.
    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 (GET_TICKER) with the FastMCP server instance.
    server.addTool(getTickerTool);
  • src/index.ts:15-15 (registration)
    Imports the getTickerTool for use in registration.
    import { getTickerTool } from "./tools/get-ticker.js";
  • Full definition of the getTickerTool object, including name, description, parameters schema, and execute handler for the GET_TICKER tool.
    export const getTickerTool = { name: "GET_TICKER", description: "Get the latest ticker data from Upbit for a single 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, "/ticker", { params: { markets: market }, }); const item = Array.isArray(data) ? (data as any[])[0] : (data as any); return JSON.stringify(item, null, 2); }, } as const;

Other Tools

Related 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