get_category
Retrieve all UI components from a specific category in the Basecoat UI library, including forms, navigation, feedback, interactive, and layout elements, to build accessible interfaces.
Instructions
Get all components in a specific category
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | Yes | Category name (forms, navigation, feedback, interactive, layout) |
Implementation Reference
- server.js:352-368 (handler)The main handler for the 'get_category' tool in the switch statement. It calls the helper getComponentsByCategory, formats a markdown list of components in the category, and returns it as tool response.case 'get_category': { const categoryData = await this.getComponentsByCategory(args.category); let output = `# ${categoryData.category.charAt(0).toUpperCase() + categoryData.category.slice(1)} Components\n\n`; for (const component of categoryData.components) { output += `- **${component.name}** (${component.file})\n`; } return { content: [ { type: 'text', text: output, }, ], }; }
- server.js:152-163 (helper)Supporting helper method that filters and returns components for a specific category, with validation for category existence.async getComponentsByCategory(category) { const components = await this.getComponentsList(); if (!components[category]) { throw new Error(`Category '${category}' not found. Available categories: ${Object.keys(components).join(', ')}`); } return { category: category, components: components[category] }; }
- server.js:235-248 (registration)Tool registration entry in the ListTools handler, defining the tool's name, description, and input schema.{ name: 'get_category', description: 'Get all components in a specific category', inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Category name (forms, navigation, feedback, interactive, layout)', }, }, required: ['category'], }, },
- server.js:238-247 (schema)Input schema definition for the 'get_category' tool, specifying the required 'category' parameter.inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Category name (forms, navigation, feedback, interactive, layout)', }, }, required: ['category'], },