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
| Name | Required | Description | Default |
|---|---|---|---|
| platform | Yes | Platform (web or native) | |
| component | Yes | Component name (e.g., "button", "checkbox") |
Implementation Reference
- src/index.ts:388-438 (handler)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, }; } }
- src/tool-definitions.ts:188-206 (schema)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);
- netlify/functions/api.js:69-83 (handler)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), }], }; }