sodax_get_token_supply
Fetch SODA token supply details including total, circulating, and burned amounts. Output in JSON or markdown.
Instructions
Get SODA token supply information including total, circulating, and burned amounts
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Response format: 'json' for raw data or 'markdown' for formatted text | markdown |
Implementation Reference
- src/services/sodaxApi.ts:300-318 (handler)Handler function that fetches SODA token supply from the SODAX API via GET /sodax/supply, with caching support.
/** * Get SODA token supply info */ export async function getTokenSupply(): Promise<TokenSupply> { const cacheKey = "token-supply"; const cached = getCached<TokenSupply>(cacheKey); if (cached) return cached; try { const response = await apiClient.get("/sodax/supply"); // API returns data directly const supply = response.data?.data || response.data; setCache(cacheKey, supply); return supply; } catch (error) { console.error("Error fetching token supply:", error); throw new Error("Failed to fetch token supply from SODAX API"); } } - src/tools/sodaxApi.ts:433-458 (registration)Tool registration using server.tool() with name 'sodax_get_token_supply', description, schema (format param), and handler that calls getTokenSupply().
// Tool 10: Get Token Supply server.tool( "sodax_get_token_supply", "Get SODA token supply information including total, circulating, and burned amounts", { format: z.nativeEnum(ResponseFormat).optional().default(ResponseFormat.MARKDOWN) .describe("Response format: 'json' for raw data or 'markdown' for formatted text") }, READ_ONLY, async ({ format }) => { try { const supply = await getTokenSupply(); return { content: [{ type: "text", text: `## SODA Token Supply\n\n` + formatResponse(supply, format) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : "Unknown error"}` }], isError: true }; } } ); - src/types.ts:178-189 (schema)TypeScript interface defining the TokenSupply schema returned by the handler.
/** * SODA token supply info */ export interface TokenSupply { totalSupply: string; circulatingSupply: string; burnedSupply?: string; lockedSupply?: string; maxSupply?: string; priceUsd?: number; marketCapUsd?: number; } - src/services/analytics.ts:61-64 (helper)Analytics category assignment mapping sodax_get_token_supply to 'api' category for usage tracking.
sodax_get_token_supply: "api", sodax_get_total_supply: "api", sodax_get_circulating_supply: "api", sodax_refresh_cache: "api", - API drift check mapping for the GET /sodax/supply endpoint to the tool name for validation purposes.
"GET /sodax/supply": { tool: "sodax_get_token_supply", params: [], requiredParams: [], responseFields: [], },