serial_wait_for
Block until a serial line matches a custom regex or built-in event (error, boot, panic), then return the match with preceding context. Eliminates polling when watching boot logs.
Instructions
Block until a line matches a custom regex ('pattern') and/or built-in event presets ('events': error/hardfault/assert/panic/boot), then return once with the hit and preceding context. Ideal for watching boot logs without polling.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "serial_wait_for"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | Serial port name, e.g. COM5 or /dev/ttyUSB0 | |
| events | No | Built-in event presets to watch | |
| pattern | No | Custom regular expression | |
| timeout_ms | No | Give up after this long (default 30000) | |
| context_lines | No | Lines of context before the match (default 5) |