get-design-token-details
Retrieve detailed information about a specific design token from Visa's Design System, including its properties and usage, to ensure consistent and accurate design implementation.
Instructions
Get detailed information about a specific design token
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Design token name |
Implementation Reference
- Core implementation of getToken method that performs the actual lookup and retrieval of design token details by name from cached data.* Get a specific design token by name */ async getToken(name: string): Promise<DesignToken> { if (!name || typeof name !== 'string') { throw this.createError('INVALID_NAME', 'Token name must be a non-empty string'); } const cachedData = this.dataManager.getCachedData(); if (!cachedData) { throw this.createError('NO_DATA', 'No design token data available'); } const token = cachedData.designTokens.find( token => token.name.toLowerCase() === name.toLowerCase() ); if (!token) { const availableTokens = cachedData.designTokens.map(token => token.name); throw this.createError('TOKEN_NOT_FOUND', `Design token "${name}" not found`, [ `Available tokens: ${availableTokens.slice(0, 10).join(', ')}${availableTokens.length > 10 ? '...' : ''}`, 'Check token name spelling', 'Use search-tokens to find similar tokens' ]); } return token; }
- src/mcp-server.ts:394-417 (handler)MCP protocol handler for the 'get-design-token-details' tool that validates input and calls the DesignTokenService./** * Handle get-design-token-details tool call */ private async handleGetDesignTokenDetails(args: Record<string, any>): Promise<CallToolResult> { const { name } = args; if (!name || typeof name !== 'string') { throw new McpError( ErrorCode.InvalidParams, 'Design token name is required and must be a string' ); } const token = await this.designTokenService.getToken(name); return { content: [ { type: 'text', text: JSON.stringify(token, null, 2) } ] }; }
- src/mcp-server.ts:147-160 (registration)Tool registration in getToolDefinitions() including name, description, and input schema.{ name: 'get-design-token-details', description: 'Get detailed information about a specific design token', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Design token name' } }, required: ['name'] } },
- src/mcp-server.ts:147-160 (schema)Input schema definition for the tool requiring a 'name' parameter.{ name: 'get-design-token-details', description: 'Get detailed information about a specific design token', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Design token name' } }, required: ['name'] } },