Skip to main content
Glama

get_token_stats

Retrieve statistical information about design tokens from Korea's government digital design system to analyze token usage and distribution patterns.

Instructions

디자인 토큰 통계 정보를 가져옵니다.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that fetches all design tokens using KRDSLoader and computes statistics by counting occurrences per token type.
    export async function getTokenStats(loader: KRDSLoader): Promise<Record<string, number>> { const allTokens = await loader.searchTokens(); const stats: Record<string, number> = {}; allTokens.forEach(token => { stats[token.type] = (stats[token.type] || 0) + 1; }); return stats; }
  • MCP server-specific handler that invokes the core getTokenStats function and formats the statistics as a sorted text response for the protocol.
    private async handleGetTokenStats() { const stats = await getTokenStats(this.loader); const text = `디자인 토큰 통계:\n\n` + Object.entries(stats) .sort((a, b) => b[1] - a[1]) .map(([type, count]) => `• ${type}: ${count}개`) .join('\n'); return { content: [{ type: 'text', text }], }; }
  • src/index.ts:176-183 (registration)
    Registers the 'get_token_stats' tool in the MCP server with description and empty input schema (no parameters required).
    { name: 'get_token_stats', description: '디자인 토큰 통계 정보를 가져옵니다.', inputSchema: { type: 'object', properties: {}, }, },
  • TypeScript type definition for the function's input (KRDSLoader) and output (Record<string, number> for token type counts).
    export async function getTokenStats(loader: KRDSLoader): Promise<Record<string, number>> {
  • src/index.ts:75-76 (registration)
    Switch case in the tool request handler that dispatches 'get_token_stats' calls to the specific handler method.
    case 'get_token_stats': return await this.handleGetTokenStats();

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/re-rank/UIUX-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server