Skip to main content
Glama
tabaldi98

bunge-ds-mcp

by tabaldi98

list-components

Lists design system components. Optionally filter by category such as form, layout, navigation, feedback, data-display, or overlay.

Instructions

Lista todos os componentes disponíveis no Design System, com filtro opcional por categoria.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFiltrar componentes por categoria

Implementation Reference

  • Handler function that registers and implements the 'list-components' tool. Filters DS_COMPONENTS by optional category and returns a JSON summary of id, name, selector, description, and category.
    export function registerListComponents(server: McpServer): void {
      server.registerTool(
        'list-components',
        {
          description: 'Lista todos os componentes disponíveis no Design System, com filtro opcional por categoria.',
          inputSchema: z.object({
            category: z
              .enum(['form', 'layout', 'navigation', 'feedback', 'data-display', 'overlay'])
              .optional()
              .describe('Filtrar componentes por categoria'),
          }),
        },
        async ({ category }) => {
          let results = DS_COMPONENTS;
    
          if (category) {
            results = results.filter((c) => c.category === (category as ComponentCategory));
          }
    
          const summary = results.map((c) => ({
            id: c.id,
            name: c.name,
            selector: c.selector,
            description: c.description,
            category: c.category,
          }));
    
          return {
            content: [{ type: 'text', text: JSON.stringify(summary, null, 2) }],
          };
        }
      );
    }
  • Input schema for the tool: optional category parameter using Zod enum validation.
    inputSchema: z.object({
      category: z
        .enum(['form', 'layout', 'navigation', 'feedback', 'data-display', 'overlay'])
        .optional()
        .describe('Filtrar componentes por categoria'),
    }),
  • Registration of the 'list-components' tool with the MCP server via server.registerTool().
    server.registerTool(
      'list-components',
  • Aggregate registration: registerAllTools calls registerListComponents which wires up the 'list-components' tool.
    export function registerAllTools(server: McpServer): void {
      registerListComponents(server);
      registerGetComponent(server);
      registerSearchComponents(server);
      registerGetComponentUsage(server);
    }
  • DS_COMPONENTS constant: the data array filtered and returned by the list-components handler.
    import { DsComponent } from '../models/mcp-server.model.js';
    
    export const DS_COMPONENTS: DsComponent[] = [
      {
        id: 'button',
        name: 'Button',
        description: 'Botão reutilizável com variantes de estilo, tamanho e estados (loading, disabled).',
        category: 'form',
        selector: 'bunge-button',
        inputs: [
          { name: 'label', type: 'string', required: true, description: 'Texto exibido no botão.' },
          { name: 'variant', type: "'primary' | 'secondary' | 'outline' | 'ghost'", required: false, default: "'primary'", description: 'Estilo visual do botão.' },
          { name: 'size', type: "'sm' | 'md' | 'lg'", required: false, default: "'md'", description: 'Tamanho do botão.' },
          { name: 'disabled', type: 'boolean', required: false, default: 'false', description: 'Desabilita interações.' },
          { name: 'loading', type: 'boolean', required: false, default: 'false', description: 'Exibe spinner e desabilita clique.' },
          { name: 'icon', type: 'string', required: false, description: 'Nome do ícone a exibir antes do label.' },
        ],
        outputs: [
          { name: 'clicked', type: 'EventEmitter<void>', required: false, description: 'Emitido ao clicar no botão.' },
        ],
        usage: `<bunge-button label="Salvar" variant="primary" (clicked)="onSave()"></bunge-button>
    
    <bunge-button label="Cancelar" variant="outline" (clicked)="onCancel()"></bunge-button>
    
    <bunge-button label="Processando..." [loading]="true"></bunge-button>`,
        importExample: `import { BungeButtonComponent } from '@bunge/ds-components';
    
    @NgModule({
      imports: [BungeButtonComponent]
    })`,
        tags: ['button', 'form', 'action', 'cta'],
      },
      {
        id: 'list',
        name: 'List',
        description: 'Componente de lista para exibir coleções de itens com suporte a seleção, ações e virtualização.',
        category: 'data-display',
        selector: 'bunge-list',
        inputs: [
          { name: 'items', type: 'any[]', required: true, description: 'Array de itens a exibir.' },
          { name: 'selectable', type: 'boolean', required: false, default: 'false', description: 'Permite seleção de itens.' },
          { name: 'multiSelect', type: 'boolean', required: false, default: 'false', description: 'Permite seleção múltipla.' },
          { name: 'emptyMessage', type: 'string', required: false, default: "'Nenhum item encontrado'", description: 'Mensagem quando a lista está vazia.' },
          { name: 'virtualScroll', type: 'boolean', required: false, default: 'false', description: 'Ativa virtualização para listas grandes.' },
          { name: 'itemTemplate', type: 'TemplateRef<any>', required: false, description: 'Template customizado para cada item.' },
        ],
        outputs: [
          { name: 'selectionChange', type: 'EventEmitter<any[]>', required: false, description: 'Emitido quando a seleção muda.' },
          { name: 'itemClick', type: 'EventEmitter<any>', required: false, description: 'Emitido ao clicar em um item.' },
        ],
        usage: `<bunge-list [items]="users" [selectable]="true" (selectionChange)="onSelect($event)">
    </bunge-list>
    
    <!-- Com template customizado -->
    <bunge-list [items]="products">
      <ng-template #itemTemplate let-item>
        <div class="product-row">{{ item.name }} - {{ item.price | currency }}</div>
      </ng-template>
    </bunge-list>`,
        importExample: `import { BungeListComponent } from '@bunge/ds-components';
    
    @NgModule({
      imports: [BungeListComponent]
    })`,
        tags: ['list', 'data', 'collection', 'selection', 'virtual-scroll'],
      },
    ];
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses basic behavior (list components, filter) but does not mention return format, pagination, or potential side effects.

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 concise sentence that front-loads the purpose and includes the optional filter, with no unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with one optional parameter and no output schema, the description is minimally adequate but does not describe return value structure or other contextual details.

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 description restates the category filter already documented in the schema, adding no extra meaning beyond what the schema provides. Schema coverage is 100%.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists all available components in the Design System with an optional category filter, distinguishing it from sibling tools like get-component (single component) and search-components (search).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use for listing with optional filtering but does not explicitly contrast with siblings or provide when-not-to-use guidance.

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/tabaldi98/mvp-for-ds-components-mcp'

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