Skip to main content
Glama
JustasMonkev

MCP Accessibility Scanner

browser_press_key

Simulate keyboard key presses during automated web accessibility scans to test and verify WCAG compliance, ensuring interactions are accessible to all users.

Instructions

Press a key on the keyboard

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesName of the key to press or a character to generate, such as `ArrowLeft` or `a`

Implementation Reference

  • The handler function that implements the core logic of the 'browser_press_key' tool by pressing the specified key using the Playwright page.keyboard.press method.
      handle: async (tab, params, response) => {
        response.setIncludeSnapshot();
        response.addCode(`// Press ${params.key}`);
        response.addCode(`await page.keyboard.press('${params.key}');`);
    
        await tab.waitForCompletion(async () => {
          await tab.page.keyboard.press(params.key);
        });
      },
    });
  • The Zod schema definition for the 'browser_press_key' tool, specifying input as a 'key' string and marking it as 'destructive'.
    schema: {
      name: 'browser_press_key',
      title: 'Press a key',
      description: 'Press a key on the keyboard',
      inputSchema: z.object({
        key: z.string().describe('Name of the key to press or a character to generate, such as `ArrowLeft` or `a`'),
      }),
      type: 'destructive',
    },
  • src/tools.ts:38-56 (registration)
    The 'browser_press_key' tool is registered as part of the 'keyboard' tools spread into the central 'allTools' array, which is filtered and provided to the MCP server backend.
    export const allTools: Tool<any>[] = [
      ...common,
      ...console,
      ...dialogs,
      ...evaluate,
      ...files,
      ...form,
      ...install,
      ...keyboard,
      ...navigate,
      ...network,
      ...mouse,
      ...pdf,
      ...screenshot,
      ...snapshot,
      ...tabs,
      ...wait,
      ...verify,
    ];

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/JustasMonkev/mcp-accessibility-scanner'

If you have feedback or need assistance with the MCP directory API, please join our Discord server