sodax_get_token_supply
Retrieve SODA token supply data including total, circulating, and burned amounts in JSON or markdown format.
Instructions
Get SODA token supply information including total, circulating, and burned amounts
Input Schema
TableJSON 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:280-298 (handler)Core implementation of getTokenSupply() service function that fetches SODA token supply data from the SODAX API endpoint '/sodax/supply'. Includes caching logic and error handling./** * 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:402-427 (registration)MCP tool registration for 'sodax_get_token_supply' with server.tool(). Defines input schema (format parameter) and the handler that calls getTokenSupply() and formats the response.// 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)Type definition for TokenSupply interface defining the structure of token supply data including totalSupply, circulatingSupply, burnedSupply, lockedSupply, maxSupply, priceUsd, and marketCapUsd./** * 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:36-37 (helper)Analytics mapping that associates 'sodax_get_token_supply' with the 'api' group for PostHog tracking of tool usage.sodax_get_partners: "api", sodax_get_token_supply: "api",
- src/index.ts:203-203 (helper)API documentation listing showing 'sodax_get_token_supply' as one of the available tools in the /api endpoint response."sodax_get_token_supply",