Skip to main content
Glama
almahdi
by almahdi

pty_write

Send input to active terminal sessions, including commands, text, and control sequences like Ctrl+C or arrow keys, for interacting with command-line programs.

Instructions

Sends input data to an active PTY session.

Use this tool to:

  • Type commands or text into an interactive terminal

  • Send special key sequences (Ctrl+C, Enter, arrow keys, etc.)

  • Respond to prompts in interactive programs

Common escape sequences:

  • Enter/newline: "\n" or "\r"

  • Ctrl+C (interrupt): "\x03"

  • Ctrl+D (EOF): "\x04"

  • Ctrl+Z (suspend): "\x1a"

  • Tab: "\t"

  • Arrow Up: "\x1b[A"

  • Arrow Down: "\x1b[B"

  • Arrow Right: "\x1b[C"

  • Arrow Left: "\x1b[D"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe PTY session ID (from pty_spawn)
dataYesInput string to send (supports escape sequences)
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/almahdi/mcp-terminal'

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