Skip to main content
Glama
MarySuneela

Visa Design System MCP Server

by MarySuneela

search-components

Find components in Visa's Design System by name, description, or other search criteria to access specifications and usage guidelines.

Instructions

Search components by name, description, or other criteria

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for components

Implementation Reference

  • The primary handler function for the 'search-components' MCP tool. Validates the query argument, delegates the search to ComponentService, and returns a JSON-formatted response with search results.
    private async handleSearchComponents(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 components = await this.componentService.searchComponents(query);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              components,
              count: components.length,
              query
            }, null, 2)
          }
        ]
      };
    }
  • The input schema and metadata definition for the 'search-components' tool, registered in the listTools response.
      name: 'search-components',
      description: 'Search components by name, description, or other criteria',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'Search query for components'
          }
        },
        required: ['query']
      }
    },
  • Registration of the tool handler in the main tool call switch statement within handleToolCall method.
    case 'search-components':
      return await this.handleSearchComponents(args);
  • The core helper method implementing the component search logic by filtering cached components based on matches in name, description, category, guidelines, and props.
    async searchComponents(query: string): Promise<Component[]> {
      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 component data available');
      }
    
      const searchTerm = query.toLowerCase();
      
      return cachedData.components.filter(component => {
        // Search in name
        if (component.name.toLowerCase().includes(searchTerm)) {
          return true;
        }
        
        // Search in description
        if (component.description.toLowerCase().includes(searchTerm)) {
          return true;
        }
        
        // Search in category
        if (component.category.toLowerCase().includes(searchTerm)) {
          return true;
        }
        
        // Search in guidelines
        if (component.guidelines.some(guideline => 
          guideline.toLowerCase().includes(searchTerm)
        )) {
          return true;
        }
        
        // Search in prop names and descriptions
        if (component.props.some(prop => 
          prop.name.toLowerCase().includes(searchTerm) ||
          prop.description.toLowerCase().includes(searchTerm)
        )) {
          return true;
        }
        
        return false;
      });
    }
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 searches components but doesn't describe how results are returned (e.g., pagination, sorting), what 'other criteria' might include, or any limitations like rate limits or authentication needs. This leaves significant gaps for a search tool.

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 that directly states the tool's function. It's front-loaded with the core action and resource, with no wasted words, though it could be slightly more structured by explicitly listing searchable fields.

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 tool with no annotations and no output schema, the description is incomplete. It doesn't explain the return format, result limitations, or how 'other criteria' work, which are critical for effective use. This falls short of what's needed for a tool with such contextual gaps.

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 schema description coverage is 100%, with the single parameter 'query' documented as 'Search query for components'. The description adds that the query can search by name, description, or other criteria, providing some extra context beyond the schema, but it doesn't detail syntax or format. This meets the baseline for high schema coverage.

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 searches components by name, description, or other criteria, which clarifies the verb (search) and resource (components). However, it doesn't differentiate from sibling tools like 'get-components' (which likely lists all components) or 'search-design-tokens' (which searches a different resource), leaving the purpose somewhat vague in context.

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 doesn't mention when to prefer this over 'get-components' for listing all components or 'search-design-tokens' for searching design tokens, nor does it specify any prerequisites or exclusions for usage.

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