list_web_components
Retrieve web accessibility components from MagentaA11y with optional category filtering to support development of accessible interfaces.
Instructions
List all available web accessibility components from MagentaA11y. Optionally filter by category (e.g., controls, forms, components).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | Optional category filter (e.g., "controls", "forms", "components") |
Implementation Reference
- src/index.ts:98-117 (handler)Core handler function that executes the list_web_components tool logic by calling contentLoader to list web components and categories, then formats the response as MCP content.async function handleListWebComponents(args: any) { const components = contentLoader.listComponents('web', args?.category); const categories = contentLoader.getCategories('web'); return { content: [ { type: 'text', text: JSON.stringify( { components, categories, }, null, 2 ), }, ], }; }
- src/tool-definitions.ts:9-20 (schema)Input schema and metadata definition for the list_web_components tool, used for MCP tool listing and validation.name: 'list_web_components', description: 'List all available web accessibility components from MagentaA11y. Optionally filter by category (e.g., controls, forms, components).', inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Optional category filter (e.g., "controls", "forms", "components")', }, }, }, },
- src/index.ts:36-40 (registration)Registers the tool list handler which exposes list_web_components in the MCP tools/list response.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: TOOL_DEFINITIONS, }; });
- src/index.ts:50-51 (registration)Dispatch registration in the main CallToolRequestSchema switch statement that routes calls to the handler.case 'list_web_components': return await handleListWebComponents(args);
- netlify/functions/api.js:26-30 (handler)Inline handler implementation for the Netlify HTTP transport version of the MCP server.case 'list_web_components': { const components = contentLoader.listComponents('web', args?.category); const categories = contentLoader.getCategories('web'); return { content: [{ type: 'text', text: JSON.stringify({ components, categories }, null, 2) }] }; }