Skip to main content
Glama
MarySuneela

Visa Design System MCP Server

by MarySuneela

search-design-tokens

Find design tokens by name or value to access Visa's Product Design System resources for consistent UI implementation.

Instructions

Search design tokens by name or value

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for token names or values

Implementation Reference

  • Core implementation of the search-design-tokens tool. Filters design tokens from cache by matching query against name, value, description, usage, and aliases (case-insensitive).
    async searchTokens(query: string): Promise<DesignToken[]> {
      if (!query || typeof query !== 'string') {
        throw this.createError('INVALID_QUERY', 'Search query must be a non-empty string');
      }
    
      const cachedData = this.dataManager.getCachedData();
      
      if (!cachedData) {
        throw this.createError('NO_DATA', 'No design token data available');
      }
    
      const searchTerm = query.toLowerCase();
      
      return cachedData.designTokens.filter(token => {
        // Search in name
        if (token.name.toLowerCase().includes(searchTerm)) {
          return true;
        }
        
        // Search in value (convert to string for search)
        if (String(token.value).toLowerCase().includes(searchTerm)) {
          return true;
        }
        
        // Search in description
        if (token.description?.toLowerCase().includes(searchTerm)) {
          return true;
        }
        
        // Search in usage array
        if (token.usage?.some(usage => 
          usage.toLowerCase().includes(searchTerm)
        )) {
          return true;
        }
        
        // Search in aliases
        if (token.aliases?.some(alias => 
          alias.toLowerCase().includes(searchTerm)
        )) {
          return true;
        }
        
        return false;
      });
    }
  • MCP server wrapper handler for search-design-tokens tool. Validates input query and delegates to DesignTokenService.searchTokens, formats response as JSON.
    private async handleSearchDesignTokens(args: Record<string, any>): Promise<CallToolResult> {
      const { query } = args;
      
      if (!query || typeof query !== 'string') {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Query parameter is required and must be a string'
        );
      }
    
      const tokens = await this.designTokenService.searchTokens(query);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              tokens,
              count: tokens.length,
              query
            }, null, 2)
          }
        ]
      };
    }
  • Tool registration in MCP server's getToolDefinitions(). Defines name, description, and input schema requiring 'query' string.
    {
      name: 'search-design-tokens',
      description: 'Search design tokens by name or value',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'Search query for token names or values'
          }
        },
        required: ['query']
      }
    },
  • Input schema for search-design-tokens tool: requires 'query' string parameter.
          query: {
            type: 'string',
            description: 'Search query for token names or values'
          }
        },
        required: ['query']
      }
    },
  • Switch case in handleToolCall that routes 'search-design-tokens' calls to the handler.
    case 'search-design-tokens':
      return await this.handleSearchDesignTokens(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 mentions searching by name or value but doesn't cover critical aspects like whether it's a read-only operation, if it requires authentication, how results are returned (e.g., pagination, format), or any rate limits. For a search tool 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 extremely concise and front-loaded, consisting of a single sentence that directly states the tool's function. There is no wasted language or redundancy, making it efficient for quick understanding by an AI agent.

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 complexity of a search operation with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits (e.g., read-only status, error handling), usage context compared to siblings, and output format. While the schema covers parameters well, the overall context for effective tool invocation 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?

The input schema has 100% description coverage, with the 'query' parameter documented as 'Search query for token names or values'. The description adds minimal value beyond this, as it essentially restates the schema's purpose without providing additional context like search syntax, case sensitivity, or examples. Baseline 3 is appropriate when 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: searching design tokens by name or value. It specifies the verb 'search' and the resource 'design tokens', making it understandable. However, it doesn't explicitly differentiate from sibling tools like 'get-design-tokens' or 'search-components', which might offer similar functionality for different resources.

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 siblings like 'get-design-tokens' (likely for listing all tokens) and 'search-components' (for searching components), there is no indication of when this tool is preferred, such as for fuzzy matching or specific token attributes. This leaves the agent without context for tool selection.

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