Skip to main content
Glama

get_web_component

Retrieve accessibility criteria for web components including WCAG mappings, acceptance criteria, and implementation guidelines to ensure compliance with accessibility standards.

Instructions

Get detailed accessibility criteria for a specific web component. Returns acceptance criteria, WCAG mappings, code examples, and implementation guidelines.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentYesComponent name (e.g., "button", "checkbox", "text-input")
include_code_examplesNoInclude code examples in response (default: true)

Implementation Reference

  • Primary handler function that executes the get_web_component tool logic. Retrieves web component accessibility data via contentLoader and includes comprehensive error handling with component suggestions.
    async function handleGetWebComponent(args: any) {
      try {
        const componentData = await contentLoader.getComponent('web', args.component);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(componentData, null, 2),
            },
          ],
        };
      } catch (error: any) {
        const suggestions = contentLoader.getSimilarComponents('web', args.component);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(
                {
                  error: 'Component not found',
                  component: args.component,
                  suggestions,
                },
                null,
                2
              ),
            },
          ],
          isError: true,
        };
      }
    }
  • Tool schema definition including name, description, and input schema with required 'component' parameter and optional code examples flag.
    {
      name: 'get_web_component',
      description: 'Get detailed accessibility criteria for a specific web component. Returns acceptance criteria, WCAG mappings, code examples, and implementation guidelines.',
      inputSchema: {
        type: 'object',
        properties: {
          component: {
            type: 'string',
            description: 'Component name (e.g., "button", "checkbox", "text-input")',
          },
          include_code_examples: {
            type: 'boolean',
            description: 'Include code examples in response (default: true)',
            default: true,
          },
        },
        required: ['component'],
      },
    },
  • src/index.ts:36-40 (registration)
    Registration of all tools, including get_web_component, via the ListToolsRequestSchema handler that returns TOOL_DEFINITIONS.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: TOOL_DEFINITIONS,
      };
    });
  • Alternative inline handler for get_web_component in the Netlify HTTP server implementation.
    case 'get_web_component': {
      const data = await contentLoader.getComponent('web', args.component);
      return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
    }
  • Registration of tools in Netlify function using shared TOOL_DEFINITIONS for list tools endpoint.
    const tools = TOOL_DEFINITIONS;
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the return content but does not specify whether this is a read-only operation, if it requires authentication, rate limits, error handling, or pagination. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 and lists return details without redundancy. Every word adds value, and there is no wasted text, making it highly 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 moderate complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. It covers the purpose and return types but lacks behavioral context and usage guidelines. Without an output schema, it should ideally detail return structure, but the mention of specific return content partially compensates.

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%, so the schema already documents both parameters fully. The description adds no additional meaning beyond what the schema provides (e.g., it doesn't explain component naming conventions or code example formats). Baseline 3 is appropriate as the schema handles parameter documentation.

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 specific action ('Get detailed accessibility criteria') and resource ('for a specific web component'), distinguishing it from siblings like 'list_web_components' (which lists components) and 'search_web_criteria' (which searches criteria). It explicitly mentions the return content (acceptance criteria, WCAG mappings, etc.), making the purpose unambiguous and distinct.

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 like 'get_component_condensed' or 'search_web_criteria'. It lacks context about prerequisites (e.g., needing a component name from a list) or exclusions (e.g., not for native components), leaving the agent to infer usage from tool names alone.

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