get_component_gherkin
Generate Gherkin-style acceptance criteria with Given/When/Then scenarios for testing component accessibility on web or native platforms.
Instructions
Get Gherkin-style acceptance criteria for a component. These are detailed Given/When/Then scenarios for testing accessibility.
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:242-275 (handler)Main handler function for the 'get_component_gherkin' tool. Retrieves Gherkin-format accessibility criteria for a specified platform and component using the contentLoader. Includes error handling with suggestions and available formats.async function handleGetComponentGherkin(args: any) { try { const content = await contentLoader.getComponentContent(args.platform, args.component, 'gherkin'); return { content: [ { type: 'text', text: content, }, ], }; } catch (error: any) { const suggestions = contentLoader.getSimilarComponents(args.platform, args.component); const formats = contentLoader.getAvailableFormats(args.platform, args.component); return { content: [ { type: 'text', text: JSON.stringify( { error: error.message, component: args.component, suggestions, availableFormats: formats, }, null, 2 ), }, ], isError: true, }; }
- src/tool-definitions.ts:112-129 (schema)Tool definition including name, description, and input schema (parameters: platform enum['web','native'], component string) for 'get_component_gherkin'.{ name: 'get_component_gherkin', description: 'Get Gherkin-style acceptance criteria for a component. These are detailed Given/When/Then scenarios for testing accessibility.', 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:62-63 (registration)Registration of the tool handler in the main switch statement for tool calls in the MCP server.case 'get_component_gherkin': return await handleGetComponentGherkin(args);
- netlify/functions/api.js:52-54 (handler)Duplicate inline handler for the Netlify HTTP transport version of the MCP server.case 'get_component_gherkin': { const content = await contentLoader.getComponentContent(args.platform, args.component, 'gherkin'); return { content: [{ type: 'text', text: content }] };