Skip to main content
Glama

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
NameRequiredDescriptionDefault
platformYesPlatform (web or native)
componentYesComponent name (e.g., "button", "checkbox")

Implementation Reference

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

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