Skip to main content
Glama
MarySuneela

Visa Design System MCP Server

by MarySuneela

get-design-tokens

Retrieve design tokens from Visa's Design System with optional filtering by category (color, typography, spacing, elevation, motion) or deprecated status.

Instructions

Get design tokens with optional category filtering

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter tokens by category (color, typography, spacing, elevation, motion)
deprecatedNoFilter by deprecated status (true for deprecated, false for active)

Implementation Reference

  • Registration of the 'get-design-tokens' tool including name, description, and input schema definition.
      name: 'get-design-tokens',
      description: 'Get design tokens with optional category filtering',
      inputSchema: {
        type: 'object',
        properties: {
          category: {
            type: 'string',
            description: 'Filter tokens by category (color, typography, spacing, elevation, motion)',
            enum: ['color', 'typography', 'spacing', 'elevation', 'motion']
          },
          deprecated: {
            type: 'boolean',
            description: 'Filter by deprecated status (true for deprecated, false for active)'
          }
        }
      }
    },
  • MCP tool handler for 'get-design-tokens' that invokes the design token service and returns formatted JSON response.
    private async handleGetDesignTokens(args: Record<string, any>): Promise<CallToolResult> {
      const tokens = await this.designTokenService.getTokens(args);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              tokens,
              count: tokens.length,
              category: args.category || 'all'
            }, null, 2)
          }
        ]
      };
    }
  • Core getTokens method in DesignTokenService that retrieves design tokens from cache and applies optional filters.
    async getTokens(options?: DesignTokenSearchOptions): Promise<DesignToken[]> {
      const cachedData = this.dataManager.getCachedData();
      
      if (!cachedData) {
        throw this.createError('NO_DATA', 'No design token data available', [
          'Ensure data files are loaded',
          'Check data directory configuration'
        ]);
      }
    
      let tokens = cachedData.designTokens;
    
      // Apply filters if provided
      if (options) {
        tokens = this.filterTokens(tokens, options);
      }
    
      return tokens;
    }
  • Helper method filterTokens used to apply category, deprecated status, and usage filters to design tokens.
    private filterTokens(tokens: DesignToken[], options: DesignTokenSearchOptions): DesignToken[] {
      return tokens.filter(token => {
        // Filter by category
        if (options.category && token.category !== options.category) {
          return false;
        }
    
        // Filter by deprecated status
        if (options.deprecated !== undefined) {
          const isDeprecated = token.deprecated === true;
          if (options.deprecated !== isDeprecated) {
            return false;
          }
        }
    
        // Filter by usage
        if (options.hasUsage && options.hasUsage.length > 0) {
          const tokenUsage = token.usage || [];
          const hasAllUsage = options.hasUsage.every(usage => 
            tokenUsage.some(tokenUsageItem => 
              tokenUsageItem.toLowerCase().includes(usage.toLowerCase())
            )
          );
          if (!hasAllUsage) {
            return false;
          }
        }
    
        return true;
      });
    }
  • Tool call routing in handleToolCall switch statement that directs to the specific handler.
    case 'get-design-tokens':
      return await this.handleGetDesignTokens(args);
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 states the tool 'Get[s] design tokens' but doesn't describe what 'design tokens' are, the return format (e.g., list, object), pagination, rate limits, authentication needs, or error handling. For a read operation with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core purpose ('Get design tokens') and adds essential scope ('with optional category filtering'). There is zero waste, and it's appropriately sized for a simple tool with two optional parameters.

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's complexity (a read operation with filtering), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'design tokens' are, the return format, or behavioral aspects like pagination. While the schema covers parameters well, the overall context for agent usage is insufficient.

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

Parameters3/5

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

Schema description coverage is 100%, with both parameters ('category' and 'deprecated') fully documented in the schema. The description adds minimal value beyond the schema by mentioning 'optional category filtering', which aligns with the 'category' parameter but doesn't provide additional syntax or format details. The baseline score of 3 is appropriate as the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the tool's purpose as 'Get design tokens with optional category filtering', which specifies the verb ('Get'), resource ('design tokens'), and scope ('with optional category filtering'). It distinguishes from siblings like 'get-design-token-details' (likely for specific tokens) and 'search-design-tokens' (likely for keyword-based queries), though it doesn't explicitly name these alternatives.

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. It mentions 'optional category filtering' but doesn't specify contexts where filtering is useful, prerequisites, or when to choose this over siblings like 'get-design-token-categories' or 'search-design-tokens'. This leaves the agent with minimal usage direction.

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/MarySuneela/mcp-vpds'

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