Skip to main content
Glama

apply_cognitive_bias

Apply cognitive biases like Fitts' Law or serial-position effect to React components to improve user experience by leveraging psychological principles in UI design.

Instructions

Aplica viés cognitivo específico para melhor UX

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentYesCódigo do componente ou nome do arquivo
biasYesViés cognitivo a aplicar

Implementation Reference

  • Handler for the 'apply_cognitive_bias' tool. Maps the input 'bias' parameter to a key in UX_GUIDELINES (e.g., 'fitts' to 'fittssLaw'), retrieves the corresponding guideline data, and returns formatted instructions text for the specified component.
    case 'apply_cognitive_bias':
      const biasMap = {
        fitts: 'fittssLaw',
        grouping: 'groupingEffect',
      };
      const biasKey = biasMap[args.bias];
      const bias = UX_GUIDELINES[biasKey];
      if (!bias) {
        return {
          content: [
            {
              type: 'text',
              text: `Viés ${args.bias} não encontrado.`,
            },
          ],
          isError: true,
        };
      }
      return {
        content: [
          {
            type: 'text',
            text: `**${bias.description}**\n\n${bias.instructions}\n\n**Componente:** ${args.component}`,
          },
        ],
      };
  • index.js:464-482 (registration)
    Registration of the 'apply_cognitive_bias' tool in the listTools response, including its name, description, and input schema.
    {
      name: 'apply_cognitive_bias',
      description: 'Aplica viés cognitivo específico para melhor UX',
      inputSchema: {
        type: 'object',
        properties: {
          component: {
            type: 'string',
            description: 'Código do componente ou nome do arquivo',
          },
          bias: {
            type: 'string',
            enum: ['fitts', 'grouping', 'proximity', 'zeigarnik', 'serial-position', 'hicks'],
            description: 'Viés cognitivo a aplicar',
          },
        },
        required: ['component', 'bias'],
      },
    },
  • Input schema definition for the 'apply_cognitive_bias' tool, specifying required 'component' string and 'bias' enum.
    inputSchema: {
      type: 'object',
      properties: {
        component: {
          type: 'string',
          description: 'Código do componente ou nome do arquivo',
        },
        bias: {
          type: 'string',
          enum: ['fitts', 'grouping', 'proximity', 'zeigarnik', 'serial-position', 'hicks'],
          description: 'Viés cognitivo a aplicar',
        },
      },
      required: ['component', 'bias'],
    },
  • UX guideline data for 'fittssLaw' bias, used by the handler when bias='fitts'. Contains description and instructions.
      fittssLaw: {
        description: "Lei de Fitts - Targets maiores e próximos",
        instructions: `
    **Lei de Fitts:**
    
    1. Touch targets mínimo 44x44px:
       \`\`\`typescript
       <IconButton sx={{ minWidth: 44, minHeight: 44 }}>
       \`\`\`
    
    2. Botões principais maiores:
       \`\`\`typescript
       <Button size="large" variant="contained">
       \`\`\`
    
    3. Espaçamento adequado:
       \`\`\`typescript
       <Stack spacing={2} direction="row">
       \`\`\`
    
    4. Ações frequentes próximas:
       - Coloque no header ou rodapé
       - Fácil acesso com polegar (mobile)
        `
      },
  • UX guideline data for 'groupingEffect' bias, used by the handler when bias='grouping'. Contains description and instructions.
      groupingEffect: {
        description: "Efeito de Agrupamento - Itens relacionados juntos",
        instructions: `
    **Agrupamento Visual:**
    
    1. Stack para agrupar:
       \`\`\`typescript
       <Stack spacing={2}>
         <TextField label="Nome" />
         <TextField label="Email" />
       </Stack>
       \`\`\`
    
    2. Divider entre seções:
       \`\`\`typescript
       <Divider sx={{ my: 2 }} />
       \`\`\`
    
    3. Cards para contextos:
       \`\`\`typescript
       <Paper elevation={2}>
         {/* conteúdo relacionado */}
       </Paper>
       \`\`\`
    
    4. Typography para títulos de seção:
       \`\`\`typescript
       <Typography variant="h6" sx={{ mb: 2 }}>
         Dados Pessoais
       </Typography>
       \`\`\`
        `
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states what the tool does at a high level ('aplica viés cognitivo') without explaining how it applies biases, what changes it makes (e.g., modifies code, generates recommendations), whether it's read-only or mutative, or any side effects. This leaves critical behavioral traits unspecified.

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, concise sentence in Portuguese that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action, making it efficient. However, it could be slightly more informative without losing conciseness, such as by hinting at the outcome.

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 complexity implied by applying cognitive biases (which could involve mutations or analysis), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns, how it affects the component, or any behavioral nuances, leaving significant gaps for an agent to understand its full context.

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?

Schema description coverage is 100%, with clear descriptions for both parameters: 'component' as a component code or filename, and 'bias' as the cognitive bias to apply with an enum list. The description adds no additional meaning beyond this, such as examples or constraints, 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.

Purpose3/5

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

The description states the tool's purpose as applying a specific cognitive bias for better UX, which is clear but vague. It uses a specific verb ('aplica') and resource ('viés cognitivo'), but doesn't distinguish from siblings like apply_apple_design or apply_nielsen_heuristic, which also seem to apply design principles. The purpose is understandable but lacks specificity about what 'aplicar' entails operationally.

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. It doesn't mention any context, prerequisites, or exclusions, and doesn't reference sibling tools like apply_complete_ux or get_ux_checklist. Without such information, the agent has no basis for choosing this tool over others in the same domain.

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/MarcusViniciusBarcelos/uiux-tools-react-mui'

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