get_tailwind_utilities
Retrieve TailwindCSS utility classes by category, CSS property, or search term to find styling solutions for web development projects.
Instructions
Get TailwindCSS utilities by category, property, or search term
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | Filter by utility category (e.g., 'layout', 'typography', 'colors') | |
| property | No | Filter by CSS property (e.g., 'margin', 'color', 'font-size') | |
| search | No | Search term to find utilities |
Implementation Reference
- src/index.ts:300-308 (handler)The tool handler that receives the request, validates parameters, and calls the utility service to fetch utilities.
private async handleGetTailwindUtilities(args: any): Promise<any> { try { const params = this.validateGetUtilitiesParams(args); const utilities = await this.utilityMapper.getUtilities(params); return this.createSuccessResponse(utilities); } catch (error) { this.handleServiceError(error, "Failed to get TailwindCSS utilities"); } } - src/services/utility-mapper.ts:129-144 (handler)The core implementation of the utility fetching logic within UtilityMapperService.
async getUtilities(params: GetUtilitiesParams): Promise<TailwindUtility[]> { let utilities: TailwindUtility[] = []; if (params.category) { utilities = this.getUtilitiesByCategory(params.category); } else if (params.property) { utilities = this.getUtilitiesByProperty(params.property); } else if (params.search) { utilities = this.searchUtilities(params.search); } else { // Return all utilities if no filter specified utilities = Array.from(this.utilityMap.values()); } return utilities; } - src/index.ts:96-96 (registration)Registration of the tool in the listTools response.
name: "get_tailwind_utilities",