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
| Name | Required | Description | Default |
|---|---|---|---|
| keys | Yes | Key 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'); } - mcp-server/src/types.ts:11-13 (schema)SendKeysRequest interface defining the input shape (keys string).
export interface SendKeysRequest { keys: string; } - mcp-server/src/mcp/tools/registration.ts:194-241 (registration)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); } }, );