import { getCssUtility } from "../db/queries.js";
export function handleGetCssUtility(db, input) {
    const { name, includeClasses = true } = input;
    // Normalize utility name (lowercase)
    const slug = name.toLowerCase();
    const utility = getCssUtility(db, slug);
    if (!utility) {
        return {
            content: [
                {
                    type: "text",
                    text: `CSS utility not found: ${name}. Available utilities: Flexy, Container, Margin, Padding, Ratio, Scroll. Use list_css_utilities to see all available utilities.`,
                },
            ],
        };
    }
    // Build output
    const output = {
        name: utility.name,
        category: utility.category,
        description: utility.description,
        classes: includeClasses ? utility.classes : [],
        examples: utility.examples.map((e) => ({
            title: e.title,
            code: e.code,
        })),
    };
    return {
        content: [
            {
                type: "text",
                text: JSON.stringify(output, null, 2),
            },
        ],
    };
}
// Tool definition for MCP
export const getCssUtilityTool = {
    name: "get_css_utility",
    description: "Get CSS utility classes and examples for Mozaic layout and spacing utilities. These are CSS-only utilities (no framework component needed). Available utilities: Flexy (flexbox grid), Container, Margin, Padding, Ratio, Scroll.",
    inputSchema: {
        type: "object",
        properties: {
            name: {
                type: "string",
                description: "Utility name (e.g., 'flexy', 'margin', 'padding', 'container', 'ratio', 'scroll')",
            },
            includeClasses: {
                type: "boolean",
                default: true,
                description: "Include all CSS class names in the response",
            },
        },
        required: ["name"],
    },
};
//# sourceMappingURL=get-css-utility.js.map