Skip to main content
Glama

list_components

Browse available React components and filter by category to find UI elements for building interfaces with its-just-ui.

Instructions

List available its-just-ui components and their categories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter components by category

Implementation Reference

  • The tool handler for 'list_components' that parses the input schema, calls componentRegistry.listComponents(category), and returns the result as a JSON string in the tool response format.
    case "list_components": {
      const { category } = ListComponentsSchema.parse(args);
      const components = componentRegistry.listComponents(category);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(components, null, 2),
          },
        ],
      };
    }
  • Zod schema defining the input for the 'list_components' tool: optional 'category' enum to filter components.
    const ListComponentsSchema = z.object({
      category: z
        .enum([
          "all",
          "core",
          "navigation",
          "form",
          "data-display",
          "feedback",
          "layout",
        ])
        .optional()
        .describe("Filter components by category"),
    });
  • src/index.ts:159-180 (registration)
    Registration of the 'list_components' tool in the ListToolsRequestHandler response, providing name, description, and input schema.
      name: "list_components",
      description:
        "List available its-just-ui components and their categories",
      inputSchema: {
        type: "object",
        properties: {
          category: {
            type: "string",
            enum: [
              "all",
              "core",
              "navigation",
              "form",
              "data-display",
              "feedback",
              "layout",
            ],
            description: "Filter components by category",
          },
        },
      },
    },
  • Core logic implementation in ComponentRegistry.listComponents that iterates over registered components, filters by optional category, and groups them by category name returning Record<string, string[]>.
    listComponents(category?: string): Record<string, string[]> {
      const result: Record<string, string[]> = {};
    
      for (const [name, info] of this.components) {
        if (!category || category === "all" || info.category === category) {
          if (!result[info.category]) {
            result[info.category] = [];
          }
          result[info.category].push(name);
        }
      }
    
      return result;
    }

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