Skip to main content
Glama
Tai-DT
by Tai-DT

optimize_classes

Optimize and clean up Tailwind CSS classes in HTML by removing redundant styles, resolving conflicts, and suggesting better alternatives.

Instructions

Optimize and clean up Tailwind CSS classes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
htmlYesHTML with Tailwind classes to optimize
removeRedundantNoRemove redundant classes
mergeConflictsNoResolve conflicting classes
suggestAlternativesNoSuggest better alternatives

Implementation Reference

  • src/index.ts:160-188 (registration)
    Registration of the 'optimize_classes' tool in the TOOLS array, including description and JSON input schema
    {
      name: 'optimize_classes',
      description: 'Optimize and clean up Tailwind CSS classes',
      inputSchema: {
        type: 'object',
        properties: {
          html: {
            type: 'string',
            description: 'HTML with Tailwind classes to optimize'
          },
          removeRedundant: {
            type: 'boolean',
            default: true,
            description: 'Remove redundant classes'
          },
          mergeConflicts: {
            type: 'boolean',
            default: true,
            description: 'Resolve conflicting classes'
          },
          suggestAlternatives: {
            type: 'boolean',
            default: true,
            description: 'Suggest better alternatives'
          }
        },
        required: ['html']
      }
    },
  • The handler function implementing the optimize_classes tool logic. Currently a placeholder that returns a mock optimization response.
    export async function optimizeClasses(args: ClassOptimizationOptions) {
      return {
        content: [
          {
            type: 'text',
            text: `Optimized classes: ${args.classes}\nContext: ${args.context || 'general'}`
          }
        ]
      };
    }
  • src/index.ts:437-438 (registration)
    Tool dispatch in the switch statement that routes 'optimize_classes' calls to the handler function.
    case 'optimize_classes':
      return await optimizeClasses(args as unknown as ClassOptimizationOptions);
  • TypeScript interface defining the expected input parameters for the optimize_classes handler (note: slight mismatch with JSON schema).
    export interface ClassOptimizationOptions {
      classes: string;
      context?: 'component' | 'layout' | 'utility' | 'responsive';
      removeRedundant?: boolean;
      sortClasses?: boolean;
      suggestAlternatives?: boolean;
      checkConflicts?: boolean;
      framework?: 'tailwind' | 'unocss' | 'windicss';
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It mentions 'optimize and clean up' which implies transformation, but doesn't specify whether this is a read-only analysis or a destructive modification, nor does it cover aspects like performance impact, error handling, or output format. This leaves significant gaps for a tool that likely modifies input.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise—a single, clear sentence that front-loads the core purpose without any wasted words. Every part of the description earns its place by directly stating what the tool does, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (involving optimization of CSS classes) and the lack of annotations and output schema, the description is insufficiently complete. It doesn't explain what 'optimize' entails in practice, what the output looks like, or any behavioral traits like safety or limitations, leaving the agent with inadequate context for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with all parameters well-documented in the schema itself. The description adds no additional parameter semantics beyond what the schema provides, such as examples or edge cases. This meets the baseline score since the schema handles the heavy lifting, but the description doesn't compensate or enhance understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('optimize and clean up') and target resource ('Tailwind CSS classes'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'suggest_improvements' or 'analyze_design', which might have overlapping functionality, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. Given sibling tools like 'suggest_improvements' and 'analyze_design' that might offer similar or complementary functions, the lack of explicit usage context or exclusions leaves the agent without clear direction for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/Tai-DT/mcp-tailwind-gemini'

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