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), }], }; }

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