get-guideline-details
Retrieve detailed design guidelines from Visa's Product Design System to ensure consistent implementation of components and tokens.
Instructions
Get detailed information about a specific guideline
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Guideline ID |
Implementation Reference
- Core handler function that executes the tool logic: validates ID, retrieves from cache, handles errors, returns the Guideline object.async getGuideline(id: string): Promise<Guideline> { return this.circuitBreaker.execute(async () => { if (!id || typeof id !== 'string') { throw new ValidationError('Guideline ID must be a non-empty string', [], { service: 'GuidelinesService', method: 'getGuideline', id }); } 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: 'getGuideline' }); } const guideline = cachedData.guidelines.find( guide => guide.id.toLowerCase() === id.toLowerCase() ); if (!guideline) { const availableGuidelines = cachedData.guidelines.map(guide => guide.id); throw new NotFoundError('Guideline', id, [ `Available guidelines: ${availableGuidelines.join(', ')}`, 'Check guideline ID spelling' ], { service: 'GuidelinesService', method: 'getGuideline' }); } return guideline; }, { service: 'GuidelinesService', method: 'getGuideline', id }); }
- src/mcp-server.ts:564-584 (handler)MCP protocol handler that validates arguments, calls the guidelines service, and formats the response as CallToolResult.private async handleGetGuidelineDetails(args: Record<string, any>): Promise<CallToolResult> { const { id } = args; if (!id || typeof id !== 'string') { throw new McpError( ErrorCode.InvalidParams, 'Guideline ID is required and must be a string' ); } const guideline = await this.guidelinesService.getGuideline(id); return { content: [ { type: 'text', text: JSON.stringify(guideline, null, 2) } ] }; }
- src/types/index.ts:54-63 (schema)Type definition for the Guideline object returned by the tool.export interface Guideline { id: string; title: string; category: string; content: string; tags: string[]; lastUpdated: Date; relatedComponents?: string[]; relatedTokens?: string[]; }
- src/mcp-server.ts:246-258 (registration)Tool registration including name, description, and input schema in the getToolDefinitions() method.name: 'get-guideline-details', description: 'Get detailed information about a specific guideline', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Guideline ID' } }, required: ['id'] } },
- src/mcp-server.ts:312-313 (registration)Dispatch case in handleToolCall switch statement that routes to the specific handler.case 'get-guideline-details': return await this.handleGetGuidelineDetails(args);