pio_monitor_read
Read new serial output from a PlatformIO monitor session since a cursor and get the next cursor. Block until a regex pattern matches or new lines arrive, with timeout and error handling.
Instructions
Read new serial lines from a session since cursor (start at 0) and get the next cursor back. Set wait_for to a regex to block up to timeout_s until a matching line arrives (e.g. wait_for='setup done|Guru Meditation'). Without wait_for and with timeout_s>0 it waits for at least one new line. When wait_for never matches the result is ok=false with error=pattern_timeout (or session_closed), plus the lines seen so far and a cursor to continue from.
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>"
},
"name": "pio_monitor_read"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cursor | No | ||
| wait_for | No | ||
| llm_model | No | The model identifier you are running as, for example "claude-opus-4-8" or "gpt-5.2". Pass "unknown" if you are not certain. Recorded for the server developer's analytics. | |
| max_lines | No | ||
| timeout_s | No | ||
| session_id | Yes | ||
| conversation_id | No | The conversation_id this server returned earlier in this conversation, unchanged, including after later user messages. Omit it if you have none. Recorded for the server developer's analytics. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| _mcp_instructions | No | Server-issued metadata for this conversation. |