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 }] };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves criteria but doesn't describe output format, pagination, error handling, or rate limits. It mentions the criteria are 'detailed' and for 'testing accessibility,' adding some context, but lacks critical behavioral traits like whether it returns structured data, requires authentication, or has side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('Get Gherkin-style acceptance criteria for a component') and adds clarifying details without waste. Every word earns its place, making it highly concise and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 required parameters, no output schema, no annotations), the description is minimally adequate. It explains what the tool does but lacks details on output format, error cases, or integration with sibling tools. Without annotations or output schema, more behavioral context would improve completeness, but it meets the baseline for a read operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear descriptions for both parameters (platform and component). The description adds no additional parameter semantics beyond what the schema provides, such as examples for component beyond 'button' or 'checkbox,' or clarifications on platform implications. Baseline 3 is appropriate since the schema adequately documents parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get Gherkin-style acceptance criteria for a component' with the specific format 'Given/When/Then scenarios for testing accessibility.' It distinguishes from siblings by focusing on Gherkin-style criteria rather than condensed notes, developer notes, or component listings. However, it doesn't explicitly contrast with search_criteria tools, keeping it from a perfect 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like get_component_condensed, get_component_developer_notes, search_native_criteria, or search_web_criteria. It mentions the criteria are 'for testing accessibility,' which hints at context, but offers no explicit when/when-not rules or prerequisites for selection among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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