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();
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states that the tool 'gets' information, implying a read operation, but doesn't describe what kind of statistics are returned, whether there are rate limits, authentication requirements, or any side effects. For a tool with zero annotation coverage, this is a significant gap in behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Korean that directly states the tool's purpose. It's appropriately sized for a no-parameter tool and front-loaded with the core action. However, it could be slightly more structured by specifying what 'statistical information' entails, but it earns its place without waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no parameters and no output schema, the description is incomplete. It doesn't explain what 'design token statistical information' includes, such as counts, usage metrics, or summary data, leaving the agent uncertain about the return values. With no annotations to provide behavioral context, the description should do more to compensate, but it falls short.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100% (since there are no parameters to describe). In such cases, the baseline score is 4, as there's no need for the description to compensate for parameter documentation. The description doesn't add parameter semantics, but that's not required here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'gets design token statistical information' (디자인 토큰 통계 정보를 가져옵니다), which provides a basic purpose with verb+resource. However, it's vague about what specific statistics are retrieved and doesn't distinguish this from sibling tools like 'search_design_tokens' or 'get_color_palette'. The description is adequate but lacks specificity about scope or differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'search_design_tokens' and 'get_color_palette' available, there's no indication of whether this tool is for aggregated statistics, summary data, or how it differs from other token-related tools. Usage context is implied at best, but not explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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