Skip to main content
Glama
tabaldi98

bunge-ds-mcp

by tabaldi98

get-component

Retrieves complete component details including inputs, outputs, usage examples, and import instructions.

Instructions

Retorna detalhes completos de um componente: inputs, outputs, exemplos de uso e import.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID do componente (ex: "button", "list")

Implementation Reference

  • Async handler that finds a component by ID from DS_COMPONENTS array and returns its full details as JSON. Returns an error message if the component is not found.
      async ({ id }) => {
        const found = DS_COMPONENTS.find((c) => c.id === id);
    
        if (!found) {
          return {
            content: [{ type: 'text', text: `Componente "${id}" não encontrado. Use list-components para ver os disponíveis.` }],
            isError: true,
          };
        }
    
        return {
          content: [{ type: 'text', text: JSON.stringify(found, null, 2) }],
        };
      }
    );
  • Input schema definition: requires a string 'id' parameter describing the component ID (e.g. 'button', 'list').
    {
      description: 'Retorna detalhes completos de um componente: inputs, outputs, exemplos de uso e import.',
      inputSchema: z.object({
        id: z.string().describe('ID do componente (ex: "button", "list")'),
      }),
  • Registration function 'registerGetComponent' that registers the 'get-component' tool on the McpServer instance.
    export function registerGetComponent(server: McpServer): void {
      server.registerTool(
        'get-component',
        {
          description: 'Retorna detalhes completos de um componente: inputs, outputs, exemplos de uso e import.',
          inputSchema: z.object({
            id: z.string().describe('ID do componente (ex: "button", "list")'),
          }),
        },
        async ({ id }) => {
          const found = DS_COMPONENTS.find((c) => c.id === id);
    
          if (!found) {
            return {
              content: [{ type: 'text', text: `Componente "${id}" não encontrado. Use list-components para ver os disponíveis.` }],
              isError: true,
            };
          }
    
          return {
            content: [{ type: 'text', text: JSON.stringify(found, null, 2) }],
          };
        }
      );
    }
  • Collective registration: 'registerAllTools' calls 'registerGetComponent(server)' to register the tool.
    registerListComponents(server);
    registerGetComponent(server);
    registerSearchComponents(server);
    registerGetComponentUsage(server);
  • Data source (DS_COMPONENTS array) containing component definitions used as the lookup data for the get-component handler.
    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 provided, so description must disclose behavior. It only states what is returned, but does not mention potential errors, authentication, rate limits, or side effects. For a read operation, basic behavioral transparency is missing.

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 sentence that efficiently conveys the tool's purpose and return value. It is front-loaded with the key action and resource.

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

Completeness4/5

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

Given no output schema, the description adequately lists the types of details returned (inputs, outputs, usage examples, import). Missing error handling or scope details, but sufficient for a simple fetch tool.

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 for the single parameter 'id'. The description does not add meaning beyond the schema example. Baseline 3 is appropriate as schema covers the parameter.

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 verb 'retorna' and the resource 'detalhes completos de um componente', specifying the content: inputs, outputs, usage examples, and import. It distinguishes from sibling tools like list-components and search-components.

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 fetching full details of a specific component, but lacks explicit guidance on when to use versus alternatives or when not to use. No exclusions or prerequisites are mentioned.

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