clear_logcat
Clear Android device logcat buffers to remove old logs and start fresh debugging sessions. Use this tool to maintain clean logs for development, testing, and troubleshooting workflows.
Instructions
Clear the logcat buffer
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": "clear_logcat"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_serial | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/adb_mcp_server/server.py:718-722 (handler)The handler function for the clear_logcat tool, registered via the @mcp.tool() decorator. It executes 'adb shell logcat -c' to clear the logcat buffer on the specified device.
@mcp.tool() def clear_logcat(device_serial: str | None = None) -> str: """Clear the logcat buffer""" return run_adb(["shell", "logcat", "-c"], device_serial)