logcat_follow
Follow Android logs in the background across calls: start with logcat filters, read new lines, wait for a regex such as a crash, then stop or list sessions.
Instructions
Follows the Android log in the background across calls. start begins collecting new lines with the same filters as logcat and returns an id. read returns the lines since the last read; with wait_for it first waits up to timeout_s for a line matching that regex, such as a crash (FATAL EXCEPTION) or your own log message. stop ends it; list shows all.
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": {
"action": "<action>"
},
"name": "logcat_follow"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Follower id for read and stop. | |
| grep | No | JavaScript regular expression a line must match. | |
| tags | No | logcat filter specs such as "ActivityManager:I" or "chromium:V"; tags not listed are hidden. | |
| action | Yes | ||
| buffers | No | ||
| package | No | Only lines logged by this app's uid. System apps such as Settings share uid 1000 with system_server. | |
| wait_for | No | For read: regex to wait for in new lines. | |
| max_lines | No | For read: return at most the last N new lines. | |
| timeout_s | No | For read with wait_for: the longest wait. | |
| min_priority | No | Lowest priority shown, for every tag not in tags. |