Skip to main content
Glama

get_component_info

Retrieve MJML component documentation and reference details to build responsive email templates with proper syntax and structure.

Instructions

Get MJML component reference and documentation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentNoSpecific component name (optional)
categoryNoComponent categoryall

Implementation Reference

  • Handler function that parses arguments using the schema, retrieves component information via helper, and returns formatted JSON content block.
    async handleGetComponentInfo(args) {
      const parsed = GetComponentInfoSchema.parse(args);
      log.info(`Getting component info: ${parsed.component || 'all'} (${parsed.category})`);
    
      const info = this.getComponentInfo(parsed.component, parsed.category);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(info, null, 2),
          },
        ],
      };
    }
  • Zod schema defining input parameters for the get_component_info tool: optional component name and category filter.
    const GetComponentInfoSchema = z.object({
      component: z.string().optional().describe('Specific component name (optional)'),
      category: z.enum(['all', 'standard', 'advanced', 'structural']).optional().default('all').describe('Component category'),
    });
  • index.js:241-259 (registration)
    Tool registration in the ListTools response, specifying name, description, and input schema.
    {
      name: 'get_component_info',
      description: 'Get MJML component reference and documentation',
      inputSchema: {
        type: 'object',
        properties: {
          component: {
            type: 'string',
            description: 'Specific component name (optional)',
          },
          category: {
            type: 'string',
            enum: ['all', 'standard', 'advanced', 'structural'],
            description: 'Component category',
            default: 'all',
          },
        },
      },
    },
  • index.js:275-276 (registration)
    Dispatch case in CallToolRequestHandler switch statement routing to the handler.
    case 'get_component_info':
      return await this.handleGetComponentInfo(args);
  • Supporting method containing the comprehensive MJML components database and logic to filter/retrieve info by component or category.
    getComponentInfo(component = null, category = 'all') {
      const components = {
        standard: {
          'mj-text': {
            description: 'Text component for displaying text content',
            attributes: {
              'font-family': 'Font family',
              'font-size': 'Font size',
              'color': 'Text color',
              'align': 'Text alignment (left, center, right)',
              'padding': 'Padding around the text',
            },
            example: '<mj-text>Hello World!</mj-text>',
          },
          'mj-button': {
            description: 'Button component for calls to action',
            attributes: {
              'background-color': 'Button background color',
              'color': 'Text color',
              'href': 'Link URL',
              'border-radius': 'Button border radius',
              'font-size': 'Font size',
            },
            example: '<mj-button href="#">Click me</mj-button>',
          },
          'mj-image': {
            description: 'Image component for displaying images',
            attributes: {
              'src': 'Image URL',
              'alt': 'Alt text',
              'width': 'Image width',
              'height': 'Image height',
              'border-radius': 'Image border radius',
            },
            example: '<mj-image src="https://example.com/image.jpg" />',
          },
          'mj-divider': {
            description: 'Divider component for creating horizontal lines',
            attributes: {
              'border-width': 'Border width',
              'border-color': 'Border color',
              'padding': 'Padding around the divider',
            },
            example: '<mj-divider border-color="#cccccc" />',
          },
          'mj-spacer': {
            description: 'Spacer component for adding vertical space',
            attributes: {
              'height': 'Spacer height',
            },
            example: '<mj-spacer height="20px" />',
          },
        },
        structural: {
          'mj-section': {
            description: 'Section component for creating rows',
            attributes: {
              'background-color': 'Section background color',
              'padding': 'Section padding',
              'full-width': 'Make section full width',
              'direction': 'Layout direction (ltr, rtl)',
            },
            example: '<mj-section background-color="#ffffff"><mj-column></mj-column></mj-section>',
          },
          'mj-column': {
            description: 'Column component for creating columns within sections',
            attributes: {
              'width': 'Column width',
              'background-color': 'Column background color',
              'padding': 'Column padding',
              'border': 'Column border',
            },
            example: '<mj-column width="50%"><mj-text>Hello</mj-text></mj-column>',
          },
          'mj-wrapper': {
            description: 'Wrapper component for grouping sections',
            attributes: {
              'background-color': 'Wrapper background color',
              'padding': 'Wrapper padding',
              'full-width': 'Make wrapper full width',
            },
            example: '<mj-wrapper><mj-section></mj-section></mj-wrapper>',
          },
        },
        advanced: {
          'mj-navbar': {
            description: 'Navigation bar component',
            attributes: {
              'background-color': 'Navbar background color',
              'align': 'Navbar alignment',
              'padding': 'Navbar padding',
            },
            example: '<mj-navbar><mj-navbar-link href="#">Home</mj-navbar-link></mj-navbar>',
          },
          'mj-social': {
            description: 'Social media icons component',
            attributes: {
              'align': 'Social icons alignment',
              'padding': 'Social icons padding',
              'icon-size': 'Icon size',
            },
            example: '<mj-social><mj-social-element name="facebook" href="#" /></mj-social>',
          },
          'mj-table': {
            description: 'Table component for displaying tabular data',
            attributes: {
              'cellspacing': 'Cell spacing',
              'cellpadding': 'Cell padding',
              'width': 'Table width',
              'align': 'Table alignment',
            },
            example: '<mj-table><tr><td>Cell 1</td><td>Cell 2</td></tr></mj-table>',
          },
          'mj-carousel': {
            description: 'Image carousel component',
            attributes: {
              'align': 'Carousel alignment',
              'border-radius': 'Carousel border radius',
              'icon-width': 'Navigation icon width',
            },
            example: '<mj-carousel><mj-carousel-image src="image1.jpg" /></mj-carousel>',
          },
        },
      };
    
      if (component) {
        for (const [cat, comps] of Object.entries(components)) {
          if (comps[component]) {
            return {
              component,
              category: cat,
              ...comps[component],
            };
          }
        }
        return { error: `Component '${component}' not found` };
      }
    
      if (category !== 'all') {
        return components[category] || {};
      }
    
      return components;
    }
Behavior2/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 states what the tool does but doesn't describe behavioral traits like whether it's read-only (implied by 'Get'), what happens if parameters are omitted, error conditions, or response format. For a tool with zero annotation coverage, this is a significant gap in transparency.

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: 'Get MJML component reference and documentation'. It's front-loaded with the core purpose, has zero waste, and is appropriately sized for a simple tool. Every word earns its place.

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 tool's simplicity (2 parameters, no output schema, no annotations), the description is incomplete. It doesn't explain what the tool returns (e.g., documentation text, examples, or structured data), how to interpret results, or any limitations. Without annotations or output schema, the description should provide more context about behavior and outputs.

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 doesn't add any meaning beyond what the input schema provides. The schema has 100% description coverage, with clear documentation for both parameters ('component' and 'category'), including enum values for 'category'. With high schema coverage, the baseline is 3, as the schema does the heavy lifting and the description doesn't compensate with additional context.

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 tool's purpose: 'Get MJML component reference and documentation' - a specific verb ('Get') and resource ('MJML component reference and documentation'). It distinguishes from siblings like 'compile_mjml', 'generate_template', and 'validate_mjml' which focus on different operations. However, it doesn't explicitly differentiate itself from potential similar documentation tools.

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 when to use it (e.g., for learning about MJML components) versus when to use sibling tools like 'compile_mjml' for processing MJML code. There's no context about prerequisites or exclusions.

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/shaunie2fly/mjml_mcp'

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