Skip to main content
Glama

list_component_formats

Retrieve available content formats for accessibility components to generate documentation in Gherkin syntax, developer notes, and other structured formats.

Instructions

List all available content formats for a specific component (e.g., gherkin, condensed, developer notes).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
platformYesPlatform (web or native)
componentYesComponent name (e.g., "button", "checkbox")

Implementation Reference

  • Primary handler function that executes the list_component_formats tool logic. Retrieves available formats for a component using contentLoader and returns formatted JSON response with descriptions.
    async function handleListComponentFormats(args: any) {
      try {
        const formats = contentLoader.getAvailableFormats(args.platform, args.component);
        const component = await contentLoader.getComponent(args.platform, args.component);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(
                {
                  component: args.component,
                  displayName: component.label,
                  platform: args.platform,
                  availableFormats: formats,
                  formatDescriptions: {
                    gherkin: 'Given/When/Then style acceptance criteria for comprehensive testing',
                    condensed: 'Shortened, focused testing instructions',
                    developerNotes: 'Implementation guidance with code examples and WCAG mappings',
                    androidDeveloperNotes: 'Android-specific implementation details',
                    iosDeveloperNotes: 'iOS-specific implementation details'
                  }
                },
                null,
                2
              ),
            },
          ],
        };
      } catch (error: any) {
        const suggestions = contentLoader.getSimilarComponents(args.platform, args.component);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(
                {
                  error: error.message,
                  component: args.component,
                  suggestions,
                },
                null,
                2
              ),
            },
          ],
          isError: true,
        };
      }
    }
  • Tool definition including name, description, and input schema (JSON Schema) for the list_component_formats tool.
    {
      name: 'list_component_formats',
      description: 'List all available content formats for a specific component (e.g., gherkin, condensed, developer notes).',
      inputSchema: {
        type: 'object',
        properties: {
          platform: {
            type: 'string',
            enum: ['web', 'native'],
            description: 'Platform (web or native)',
          },
          component: {
            type: 'string',
            description: 'Component name (e.g., "button", "checkbox")',
          },
        },
        required: ['platform', 'component'],
      },
    },
  • src/index.ts:36-40 (registration)
    Registration of all tools (including list_component_formats) for the MCP ListToolsRequestHandler via shared TOOL_DEFINITIONS.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: TOOL_DEFINITIONS,
      };
    });
  • src/index.ts:70-71 (registration)
    Registration/dispatch of list_component_formats tool call to its handler function in the main CallToolRequestHandler switch statement.
    case 'list_component_formats':
      return await handleListComponentFormats(args);
  • Alternative inline handler for list_component_formats in the Netlify HTTP transport deployment.
    case 'list_component_formats': {
      const formats = contentLoader.getAvailableFormats(args.platform, args.component);
      const component = await contentLoader.getComponent(args.platform, args.component);
      return {
        content: [{
          type: 'text',
          text: JSON.stringify({
            component: args.component,
            displayName: component.label,
            platform: args.platform,
            availableFormats: formats,
          }, null, 2),
        }],
      };
    }
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 the tool lists formats but doesn't cover critical aspects like whether it's a read-only operation, potential side effects, error handling, rate limits, or authentication needs. For a tool with no annotation coverage, this lack of behavioral context is a significant gap, though it doesn't contradict any annotations.

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 that front-loads the core purpose ('List all available content formats for a specific component') and includes helpful examples ('e.g., gherkin, condensed, developer notes'). There is no wasted text, and every word contributes to clarifying the tool's function, making it appropriately concise and well-structured.

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 the tool's low complexity (2 required parameters, no output schema, no nested objects) and high schema coverage, the description is minimally adequate. It explains what the tool does but lacks details on behavioral traits, usage guidelines, and output format, which are important for a tool with no annotations. This results in a basic but incomplete understanding, suitable for a score of 3.

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 schema description coverage is 100%, with both parameters (platform and component) well-documented in the input schema. The description adds no additional parameter semantics beyond implying the component name examples (e.g., 'button', 'checkbox') align with the schema. This meets the baseline score of 3, as the schema adequately handles parameter documentation without needing extra details from the description.

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: 'List all available content formats for a specific component' with examples like 'gherkin, condensed, developer notes'. This specifies the verb ('List'), resource ('content formats'), and scope ('for a specific component'), making it easy to understand what the tool does. However, it doesn't explicitly distinguish it from sibling tools like get_component_condensed or get_component_gherkin, which might retrieve specific formats rather than list them all.

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 sibling tools such as get_component_condensed or list_web_components, nor does it specify prerequisites, exclusions, or contextual cues for selection. This leaves the agent without explicit usage instructions, relying solely on inference from the tool name and description.

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/joe-watkins/magentaa11y-mcp-remote'

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