Skip to main content
Glama

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
NameRequiredDescriptionDefault
letterYesThe letter corresponding to the control character (e.g., "C" for Ctrl+C)

Implementation Reference

  • 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'],
      },
    },
  • 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'],
    },

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/capecoma/winterm-mcp'

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