Skip to main content
Glama

create_responsive_layout

Generate responsive layouts using Tailwind CSS and its-just-ui components for grid, flexbox, container, sidebar, hero, and card-grid designs with customizable breakpoints.

Instructions

Create a responsive layout using Tailwind CSS and its-just-ui components

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYes
breakpointsNo

Implementation Reference

  • The core handler function that implements the create_responsive_layout tool logic. It returns predefined responsive layout JSX templates based on the provided type (grid, flexbox, container, sidebar, hero, card-grid).
      createResponsiveLayout(config: {
        type: string;
        breakpoints?: Record<string, string>;
      }): string {
        const { type } = config;
    
        const layouts: Record<string, string> = {
          grid: `// Responsive Grid Layout
    <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 p-4">
      <Card>Item 1</Card>
      <Card>Item 2</Card>
      <Card>Item 3</Card>
      <Card>Item 4</Card>
    </div>`,
    
          flexbox: `// Responsive Flexbox Layout
    <div className="flex flex-col md:flex-row gap-4 p-4">
      <div className="flex-1">
        <Card>Flex Item 1</Card>
      </div>
      <div className="flex-1">
        <Card>Flex Item 2</Card>
      </div>
      <div className="flex-1">
        <Card>Flex Item 3</Card>
      </div>
    </div>`,
    
          container: `// Responsive Container Layout
    <div className="container mx-auto px-4 sm:px-6 lg:px-8">
      <div className="max-w-7xl mx-auto">
        <h1 className="text-2xl md:text-3xl lg:text-4xl font-bold mb-4">
          Page Title
        </h1>
        <div className="prose lg:prose-xl">
          {/* Content */}
        </div>
      </div>
    </div>`,
    
          sidebar: `// Responsive Sidebar Layout
    <div className="flex flex-col md:flex-row min-h-screen">
      {/* Sidebar */}
      <aside className="w-full md:w-64 lg:w-72 bg-gray-100 p-4">
        <nav>
          <ul className="space-y-2">
            <li><Anchor href="#home">Home</Anchor></li>
            <li><Anchor href="#about">About</Anchor></li>
            <li><Anchor href="#contact">Contact</Anchor></li>
          </ul>
        </nav>
      </aside>
      
      {/* Main Content */}
      <main className="flex-1 p-4 md:p-6 lg:p-8">
        {/* Content */}
      </main>
    </div>`,
    
          hero: `// Responsive Hero Section
    <section className="relative bg-gradient-to-r from-blue-500 to-purple-600 text-white">
      <div className="container mx-auto px-4 py-16 md:py-24 lg:py-32">
        <div className="max-w-4xl mx-auto text-center">
          <h1 className="text-3xl md:text-5xl lg:text-6xl font-bold mb-4">
            Welcome to Our Site
          </h1>
          <p className="text-lg md:text-xl lg:text-2xl mb-8">
            Build amazing experiences with its-just-ui
          </p>
          <div className="flex flex-col sm:flex-row gap-4 justify-center">
            <Button size="lg" variant="primary">Get Started</Button>
            <Button size="lg" variant="outline">Learn More</Button>
          </div>
        </div>
      </div>
    </section>`,
    
          "card-grid": `// Responsive Card Grid
    <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 md:gap-6 p-4">
      {[1, 2, 3, 4, 5, 6, 7, 8].map((item) => (
        <Card key={item} variant="elevated" className="hover:shadow-xl transition-shadow">
          <div className="aspect-video bg-gray-200 rounded-t-lg mb-4"></div>
          <h3 className="text-lg font-semibold mb-2">Card Title {item}</h3>
          <p className="text-gray-600 mb-4">Card description goes here.</p>
          <Button variant="primary" fullWidth>View Details</Button>
        </Card>
      ))}
    </div>`,
        };
    
        return layouts[type] || layouts.container;
      },
  • src/index.ts:247-277 (registration)
    Registration of the 'create_responsive_layout' tool in the MCP server, including name, description, and input schema.
    {
      name: "create_responsive_layout",
      description:
        "Create a responsive layout using Tailwind CSS and its-just-ui components",
      inputSchema: {
        type: "object",
        properties: {
          type: {
            type: "string",
            enum: [
              "grid",
              "flexbox",
              "container",
              "sidebar",
              "hero",
              "card-grid",
            ],
          },
          breakpoints: {
            type: "object",
            properties: {
              sm: { type: "string" },
              md: { type: "string" },
              lg: { type: "string" },
              xl: { type: "string" },
            },
          },
        },
        required: ["type"],
      },
    },
  • MCP server request handler that parses input, calls the utilityTools.createResponsiveLayout function, and returns the result.
    case "create_responsive_layout": {
      const config = z
        .object({
          type: z.string(),
          breakpoints: z.record(z.string()).optional(),
        })
        .parse(args);
      const layout = utilityTools.createResponsiveLayout(config);
      return {
        content: [
          {
            type: "text",
            text: layout,
          },
        ],
      };
    }
  • Input schema definition for the create_responsive_layout tool, specifying the expected parameters.
      inputSchema: {
        type: "object",
        properties: {
          type: {
            type: "string",
            enum: [
              "grid",
              "flexbox",
              "container",
              "sidebar",
              "hero",
              "card-grid",
            ],
          },
          breakpoints: {
            type: "object",
            properties: {
              sm: { type: "string" },
              md: { type: "string" },
              lg: { type: "string" },
              xl: { type: "string" },
            },
          },
        },
        required: ["type"],
      },
    },
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. It states the tool creates something, implying a write operation, but doesn't disclose any behavioral traits such as what gets created (e.g., code, configuration files), whether it requires specific permissions, what happens on failure, or any rate limits. The description is minimal and lacks essential context for safe and effective use.

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

Conciseness4/5

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

The description is a single, efficient sentence that gets straight to the point without unnecessary words. It's appropriately sized for a simple tool, though it could be more front-loaded with critical details. There's no wasted verbiage, earning it a high score for conciseness.

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 complexity (2 parameters with nested objects, no output schema, and no annotations), the description is incomplete. It doesn't explain what the tool returns, how parameters affect the output, or any behavioral nuances. For a creation tool with undocumented parameters, this leaves significant gaps in understanding how to use it effectively.

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

Parameters2/5

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

The input schema has 0% description coverage, so the description must compensate but fails to do so. It mentions no parameters at all, leaving both 'type' (with its enum values) and 'breakpoints' completely undocumented. The description adds no meaning beyond what the bare schema provides, which is inadequate given the low coverage.

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 ('Create a responsive layout') and specifies the technologies used ('using Tailwind CSS and its-just-ui components'), which provides a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'generate_component' or 'compose_components' that might also create UI elements, leaving some ambiguity about scope boundaries.

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. There are no explicit when/when-not instructions, no mention of prerequisites, and no references to sibling tools like 'generate_component' or 'compose_components' that might handle similar tasks. Usage context is implied but not articulated.

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/its-just-ui/its-just-mcp'

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