Skip to main content
Glama

send_keys

Send keystroke sequences to control your computer using hotkeys. Provides a clear error response when the send endpoint is unsupported.

Instructions

Send keystrokes through optional /send_keys endpoint. Returns clear error when endpoint is unsupported.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keysYesKey sequence to send.

Implementation Reference

  • CommandExecutionService.sendKeys() - domain-level handler that delegates to the client's sendKeys method.
    public async sendKeys(input: SendKeysRequest): Promise<EndpointActionResult> {
      return this.client.sendKeys(input);
    }
  • HotkeylessAhkClient.sendKeys() - sends keystrokes by calling the optional /send_keys endpoint via triggerCommand.
    public async sendKeys(payload: SendKeysRequest): Promise<EndpointActionResult> {
      return this.tryOptionalEndpoint(payload, 'send_keys');
    }
  • SendKeysRequest interface defining the input shape (keys string).
    export interface SendKeysRequest {
      keys: string;
    }
  • Registration of the 'send_keys' MCP tool with its schema description, inputSchema (zod), and handler logic that calls executionService.sendKeys.
    server.registerTool(
      'send_keys',
      {
        description:
          'Send keystrokes through optional /send_keys endpoint. Returns clear error when endpoint is unsupported.',
        inputSchema: {
          keys: z.string().min(1).max(1000).describe('Key sequence to send.'),
        },
      },
      async ({ keys }) => {
        logInfo('tool.send_keys.start', {
          keysLength: keys.length,
        });
    
        try {
          const result = await executionService.sendKeys({
            keys,
          });
    
          logInfo('tool.send_keys.success', {
            keysLength: keys.length,
            status: result.status,
          });
    
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(
                  {
                    status: result.status,
                    ok: true,
                    response: result.body,
                  },
                  null,
                  2,
                ),
              },
            ],
          };
        } catch (error) {
          logError('tool.send_keys.failure', error, {
            keysLength: keys.length,
          });
          return toErrorResult(error);
        }
      },
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It only discloses the error behavior when the endpoint is unsupported, but lacks details on whether the action is destructive, reversible, or any other behavioral traits.

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 two sentences, front-loaded with the core action, and contains no extraneous information.

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?

For a simple tool with one parameter and no output schema, the description is minimally complete. It covers the purpose and error handling but omits details like key format or special keys, leaving some ambiguity.

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 coverage is 100% and the parameter 'keys' is described as 'Key sequence to send.' The description adds no additional meaning beyond 'keystrokes', so it meets the baseline but does not enhance understanding.

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 'Send keystrokes' (specific verb+resource) and mentions the endpoint and error handling, but does not explicitly distinguish from sibling tools like trigger_command.

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 mentions that the endpoint is optional and will return an error if unsupported, but gives no guidance on when to use this tool versus alternatives or any prerequisites.

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/tim0-12432/HotkeylessAHK-mcp-skill'

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