Skip to main content
Glama
tabaldi98

bunge-ds-mcp

by tabaldi98

search-components

Search design system components by name, description, or tags to locate the component you need.

Instructions

Busca componentes por nome, descrição ou tags.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesTermo de busca para encontrar componentes

Implementation Reference

  • The main handler function 'registerSearchComponents' that registers the 'search-components' tool. It takes a query parameter, filters DS_COMPONENTS by name/description/tags, and returns matching components as formatted JSON text.
    export function registerSearchComponents(server: McpServer): void {
      server.registerTool(
        'search-components',
        {
          description: 'Busca componentes por nome, descrição ou tags.',
          inputSchema: z.object({
            query: z.string().describe('Termo de busca para encontrar componentes'),
          }),
        },
        async ({ query }) => {
          const term = query.toLowerCase();
    
          const results = DS_COMPONENTS.filter(
            (c) =>
              c.name.toLowerCase().includes(term) ||
              c.description.toLowerCase().includes(term) ||
              c.tags.some((t) => t.toLowerCase().includes(term))
          );
    
          const summary = results.map((c) => ({
            id: c.id,
            name: c.name,
            selector: c.selector,
            description: c.description,
            category: c.category,
            tags: c.tags,
          }));
    
          return {
            content: [{ type: 'text', text: JSON.stringify(summary, null, 2) }],
          };
        }
      );
    }
  • Input schema for the 'search-components' tool. Defines a single required 'query' string parameter for searching components by name, description, or tags.
    {
      description: 'Busca componentes por nome, descrição ou tags.',
      inputSchema: z.object({
        query: z.string().describe('Termo de busca para encontrar componentes'),
      }),
  • src/tools/index.ts:4-4 (registration)
    Import of the search-components registration function in the tools index.
    import { registerSearchComponents } from './search-components.js';
  • Registration call for the search-components tool within registerAllTools.
    registerSearchComponents(server);
  • The DS_COMPONENTS data array that the search-components tool queries against. Contains component objects with id, name, description, tags, and other metadata.
    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'],
      },
    ];
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It only states the search fields (name, description, tags) but omits details like case sensitivity, partial matching, pagination, or read-only nature. This is insufficient for a search tool.

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, front-loaded sentence that conveys the core purpose. It is appropriately sized for a simple tool with one parameter, though it could include brief behavioral notes.

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?

Given no output schema and simple parameters, the description is minimally adequate but lacks details on return format, pagination, or matching behavior. It covers the essential 'what' but not the 'how' of results.

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

Parameters4/5

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

The schema covers the single parameter with a description ('search term'), and the description adds value by specifying the fields searched (name, description, tags). This extra context helps the agent understand what the query matches against.

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 action (search) and the resource (components) with the scope (by name, description, or tags). It distinguishes from sibling tools like list-components (which lists all) and get-component (single component retrieval).

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

Usage Guidelines4/5

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

The description implies usage context: use this tool when searching components by specific terms. While it does not explicitly mention alternatives, the sibling tool names (list-components, get-component) naturally differentiate the use cases.

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