get-guidelines
Retrieve design guidelines from Visa's Product Design System with optional category filtering to access specific resources and ensure consistent product design.
Instructions
Get design guidelines with optional category filtering
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | Filter guidelines by category |
Implementation Reference
- src/mcp-server.ts:542-559 (handler)MCP tool handler for 'get-guidelines' that invokes GuidelinesService.getGuidelines and returns formatted JSON response with guidelines list, count, and filters.* Handle get-guidelines tool call */ private async handleGetGuidelines(args: Record<string, any>): Promise<CallToolResult> { const guidelines = await this.guidelinesService.getGuidelines(args); return { content: [ { type: 'text', text: JSON.stringify({ guidelines, count: guidelines.length, filters: args }, null, 2) } ] }; }
- src/mcp-server.ts:232-244 (registration)Registration of the 'get-guidelines' tool in getToolDefinitions(), including name, description, and input schema.{ name: 'get-guidelines', description: 'Get design guidelines with optional category filtering', inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Filter guidelines by category' } } } },
- src/mcp-server.ts:232-244 (schema)Input schema definition for the 'get-guidelines' tool, allowing optional category filter.{ name: 'get-guidelines', description: 'Get design guidelines with optional category filtering', inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Filter guidelines by category' } } } },
- Helper method in GuidelinesService that retrieves guidelines from data cache, applies optional filters (including category), with error handling and circuit breaker.@handleErrors async getGuidelines(options?: GuidelineSearchOptions): Promise<Guideline[]> { return this.circuitBreaker.execute(async () => { const cachedData = this.dataManager.getCachedData(); if (!cachedData) { throw new DataError('No guidelines data available', [ 'Ensure data files are loaded', 'Check data directory configuration' ], { service: 'GuidelinesService', method: 'getGuidelines' }); } let guidelines = cachedData.guidelines; // Apply filters if provided if (options) { guidelines = this.filterGuidelines(guidelines, options); } return guidelines; }, { service: 'GuidelinesService', method: 'getGuidelines', options }); }