get-guidelines
Retrieve design guidelines from Visa's Product Design System with optional category filtering to access component specifications and usage resources.
Instructions
Get design guidelines with optional category filtering
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | Filter guidelines by category |
Implementation Reference
- src/mcp-server.ts:544-559 (handler)MCP tool handler that delegates to GuidelinesService.getGuidelines and formats the result as JSON response with count and applied filters.
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) } ] }; } - Core service method that retrieves guidelines from data cache, applies category/other filters via filterGuidelines, with circuit breaker and comprehensive error handling.
@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 }); } - src/mcp-server.ts:232-244 (registration)Tool registration definition in getToolDefinitions(): includes name, description, and input schema for category filtering.
{ 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:235-242 (schema)Input schema definition for the get-guidelines tool, allowing optional category filter.
inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Filter guidelines by category' } } - src/mcp-server.ts:310-311 (handler)Switch case routing get-guidelines tool calls to the specific handler function.
case 'get-guidelines': return await this.handleGetGuidelines(args);