serial_write
Send a command to an active serial shell session to interact with an embedded device. Use this tool for writing shell input while avoiding concurrent reads that corrupt the output buffer.
Instructions
Send a command to a serial shell session. Do NOT call this concurrently with serial_exec/serial_read on the same session_id — concurrent access to the same serial console corrupts the output buffer.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"session_id": "<session_id>",
"command": "<command>"
},
"name": "serial_write"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clear | No | Buffer clear flag: 1 (default) = clear buffer before collecting, 0 = append to buffer | |
| command | Yes | The command to send to the shell | |
| session_id | Yes | The session ID returned by serial_open |