Skip to main content
Glama

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
NameRequiredDescriptionDefault
categoryYesCategory name (forms, navigation, feedback, interactive, layout)

Implementation Reference

  • 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,
          },
        ],
      };
    }
  • 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'],
      },
    },
  • 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'],
    },
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 a read operation ('Get'), but doesn't mention any behavioral traits such as permissions needed, rate limits, pagination, or what happens if the category doesn't exist. This leaves significant gaps for a tool that likely interacts with a data source.

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 a single, efficient sentence that directly states the tool's function without any wasted words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what 'components' are, what format they're returned in, or any error conditions. For a tool with one parameter but no structured context, more detail would be helpful for the agent to use it effectively.

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 input schema has 100% description coverage, with the 'category' parameter documented as 'Category name (forms, navigation, feedback, interactive, layout)'. The description adds no additional parameter semantics beyond this, so it meets the baseline of 3 where the schema does the heavy lifting.

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 ('Get all components') and the target resource ('in a specific category'), making the purpose immediately understandable. It doesn't explicitly distinguish from siblings like 'list_components' or 'search_components', which is why it doesn't reach a perfect score of 5.

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 like 'list_components' or 'search_components'. It lacks any context about prerequisites, exclusions, or comparative use cases, leaving the agent to infer usage based on the tool name alone.

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/GustavoGomezPG/basecoat-mcp'

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