get-components
Retrieve Visa Design System components with optional filters by category or name to access specifications and usage guidelines.
Instructions
Get all components with optional filtering
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | Filter components by category | |
| name | No | Filter components by name (partial match) |
Implementation Reference
- src/services/component-service.ts:34-52 (handler)Core implementation of get-components: fetches components from cached data manager and applies filters by category, name, props, or variants.async getComponents(options?: ComponentSearchOptions): Promise<Component[]> { const cachedData = this.dataManager.getCachedData(); if (!cachedData) { throw this.createError('NO_DATA', 'No component data available', [ 'Ensure data files are loaded', 'Check data directory configuration' ]); } let components = cachedData.components; // Apply filters if provided if (options) { components = this.filterComponents(components, options); } return components; }
- src/mcp-server.ts:441-456 (handler)MCP protocol handler for 'get-components' tool: delegates to ComponentService.getComponents and formats result as MCP CallToolResult with JSON content.private async handleGetComponents(args: Record<string, any>): Promise<CallToolResult> { const components = await this.componentService.getComponents(args); return { content: [ { type: 'text', text: JSON.stringify({ components, count: components.length, filters: args }, null, 2) } ] }; }
- src/mcp-server.ts:172-187 (schema)Input schema and metadata definition for the 'get-components' tool, defining optional category and name filters.name: 'get-components', description: 'Get all components with optional filtering', inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Filter components by category' }, name: { type: 'string', description: 'Filter components by name (partial match)' } } } },
- src/mcp-server.ts:300-301 (registration)Registration of 'get-components' handler in the MCP tool call router (switch statement).case 'get-components': return await this.handleGetComponents(args);
- TypeScript interface defining filter options used by getComponents handler (category, name, hasProps, hasVariants).export interface ComponentSearchOptions { category?: string; name?: string; hasProps?: string[]; hasVariants?: string[]; }