send_control_character
Send control signals like Ctrl+C to interrupt processes in the Windows terminal through programmatic access, enabling automated command line interaction.
Instructions
Send a control character to the terminal
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| letter | Yes | The letter corresponding to the control character (e.g., "C" for Ctrl+C) |
Implementation Reference
- src/index.ts:138-152 (handler)The handler for the 'send_control_character' tool. It extracts the 'letter' from arguments, simulates Ctrl+C on Windows using taskkill if letter is 'C', and returns a confirmation message.case 'send_control_character': { const { letter } = request.params.arguments as { letter: string }; // On Windows, we'll use taskkill to simulate Ctrl+C if (letter.toUpperCase() === 'C' && os.platform() === 'win32') { exec('taskkill /im node.exe /f'); } return { content: [ { type: 'text', text: `Sent Ctrl+${letter.toUpperCase()} signal`, }, ], }; }
- src/index.ts:70-83 (registration)Registration of the 'send_control_character' tool in the ListToolsRequestSchema response, including name, description, and input schema definition.{ name: 'send_control_character', description: 'Send a control character to the terminal', inputSchema: { type: 'object', properties: { letter: { type: 'string', description: 'The letter corresponding to the control character (e.g., "C" for Ctrl+C)', }, }, required: ['letter'], }, },
- src/index.ts:73-82 (schema)Input schema for the 'send_control_character' tool, defining the required 'letter' parameter.inputSchema: { type: 'object', properties: { letter: { type: 'string', description: 'The letter corresponding to the control character (e.g., "C" for Ctrl+C)', }, }, required: ['letter'], },