get-guideline-details
Retrieve comprehensive details for a specific design guideline by providing its ID using the Visa Design System MCP Server. Access essential information for consistent design implementation.
Instructions
Get detailed information about a specific guideline
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Guideline ID |
Implementation Reference
- src/mcp-server.ts:564-584 (handler)MCP tool handler for get-guideline-details. Validates the guideline ID input, fetches the guideline details from the guidelinesService, and returns the result as a JSON-formatted text content block.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/mcp-server.ts:245-258 (registration)Tool registration in the getTools() method, including name, description, and input schema definition.{ 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:248-257 (schema)Input schema definition for the get-guideline-details tool, specifying the required 'id' parameter.inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Guideline ID' } }, required: ['id'] }
- Core helper function in GuidelinesService that retrieves a specific guideline by ID from cached data, including validation, error handling, and case-insensitive lookup.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 }); }