Skip to main content
Glama

generate_tailwind_classes

Creates Tailwind CSS utility classes for spacing, colors, typography, layout, and effects to streamline UI development and design consistency.

Instructions

Generate Tailwind utility classes for specific use cases

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYes
valuesNo

Implementation Reference

  • Core implementation of generate_tailwind_classes tool. Switches on 'type' and delegates to specific class generators (spacing, colors, typography, layout, effects). Returns formatted Tailwind classes string.
    generateTailwindClasses(type: string, values?: Record<string, any>): string { switch (type) { case "spacing": return this.generateSpacingClasses(values); case "colors": return this.generateColorClasses(values); case "typography": return this.generateTypographyClasses(values); case "layout": return this.generateLayoutClasses(values); case "effects": return this.generateEffectClasses(values); default: return "// Unknown type"; } },
  • MCP server request handler for the tool. Parses arguments with schema, calls utilityTools.generateTailwindClasses, and returns the result as text content.
    case "generate_tailwind_classes": { const { type, values } = GenerateTailwindClassesSchema.parse(args); const classes = utilityTools.generateTailwindClasses(type, values); return { content: [ { type: "text", text: classes, }, ], };
  • Zod schema defining the input structure: required 'type' enum and optional 'values' object.
    const GenerateTailwindClassesSchema = z.object({ type: z.enum(["spacing", "colors", "typography", "layout", "effects"]), values: z.record(z.any()).optional(), });
  • src/index.ts:233-245 (registration)
    Tool registration in ListTools handler, providing name, description, and JSON schema for input validation in MCP protocol.
    name: "generate_tailwind_classes", description: "Generate Tailwind utility classes for specific use cases", inputSchema: { type: "object", properties: { type: { type: "string", enum: ["spacing", "colors", "typography", "layout", "effects"], }, values: { type: "object" }, }, required: ["type"], },

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/its-just-ui/its-just-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server