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

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It states what the tool does but doesn't disclose important traits like whether this requires an active connection, what happens if no application is connected, whether input is queued or immediate, or any error conditions. For a tool that interacts with external applications, this is a significant gap.

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 directly states the tool's purpose with zero wasted words. It's appropriately sized and front-loaded, making it easy to understand immediately.

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

Completeness2/5

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

Given the tool's complexity (interacting with external applications) and lack of annotations or output schema, the description is incomplete. It doesn't address connection requirements, error handling, or what constitutes successful execution. For a tool with three parameters and no structured safety hints, more context is needed.

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%, so the schema already documents all three parameters thoroughly. The description adds no additional parameter information beyond what's in the schema, maintaining the baseline score of 3 where the schema does the heavy lifting.

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 action ('Send keyboard input') and target ('to the connected Scenic application'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like send_mouse_click or send_mouse_move, which handle different input types.

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. It doesn't mention prerequisites (like requiring a connected application via connect_scenic), nor does it explain when keyboard input is appropriate versus mouse actions from sibling tools.

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

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