Skip to main content
Glama

send_keys

Simulate keyboard input by sending text or special keys to Scenic applications. Use modifiers like ctrl, shift, alt, or meta for complex interactions. Ideal for testing and automation via Scenic MCP server.

Instructions

Send keyboard input to the connected Scenic application

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyNoSpecial key name (e.g., enter, escape, tab, backspace, delete, up, down, left, right, home, end, page_up, page_down, f1-f12)
modifiersNoModifier keys to hold while pressing the key
textNoText to type (each character will be sent as individual key presses)

Implementation Reference

  • The handler function that executes the 'send_keys' tool. It validates connection to Scenic app, checks input parameters, constructs a command with action 'send_keys', sends it to the Elixir backend via connection, parses response, and returns success/error messages.
    async function handleSendKeys(args: any) { try { const isRunning = await conn.checkTCPServer(); if (!isRunning) { return { content: [ { type: 'text', text: 'Cannot send keys: No Scenic application connected.\n\nUse connect_scenic first or start your Scenic application. The MCP server will automatically detect when the app becomes available.', }, ], isError: false, }; } const { text, key, modifiers } = args; if (!text && !key) { return { content: [ { type: 'text', text: 'Error: Must provide either "text" or "key" parameter', }, ], isError: true, }; } const command = { action: 'send_keys', text, key, modifiers: modifiers || [], }; const response = await conn.sendToElixir(command); const data = JSON.parse(response); if (data.error) { return { content: [ { type: 'text', text: `Error sending keys: ${data.error}`, }, ], isError: true, }; } return { content: [ { type: 'text', text: `Keys sent successfully!\n${JSON.stringify(data, null, 2)}`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error sending keys: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
  • Tool schema definition including name, description, and inputSchema specifying parameters for text, key, and modifiers with types and descriptions.
    { name: 'send_keys', description: 'KEYBOARD INPUT: Send text input or special keystrokes to the Scenic application. Use for typing text, navigation shortcuts, testing keyboard interactions. Supports text, special keys (enter, escape, tab), and modifier combinations (ctrl+c, cmd+s).', inputSchema: { type: 'object', properties: { text: { type: 'string', description: 'Text to type (each character will be sent as individual key presses)', }, key: { type: 'string', description: 'Special key name (e.g., enter, escape, tab, backspace, delete, up, down, left, right, home, end, page_up, page_down, f1-f12)', }, modifiers: { type: 'array', items: { type: 'string', enum: ['ctrl', 'shift', 'alt', 'cmd', 'meta'], }, description: 'Modifier keys to hold while pressing the key', }, }, }, },
  • src/tools.ts:194-195 (registration)
    Registration in the tool handler router (handleToolCall switch statement) that dispatches 'send_keys' calls to the handleSendKeys function.
    case 'send_keys': return await handleSendKeys(args);

Other Tools

Related 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/scenic-contrib/scenic_mcp_experimental'

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