Skip to main content
Glama

Clear logcat

clear_logcat
DestructiveIdempotent

Clear the Android device's logcat ring buffer before performing a single action, so every captured log line is attributable to that action and stale entries do not skew results.

Instructions

Empty the device's logcat ring buffer (adb logcat -c). The sharpest isolation primitive for a press→observe loop: clear, perform ONE action, then logcat — every line you read was caused by that action. Without it, a filter hit may be minutes old and an empty result may just mean the buffer rotated. (For reaching BACK in time instead, use logcat's since param.)

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

NameRequiredDescriptionDefault
serialNoTarget device serial (adb -s). Optional when exactly one device is attached.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already flag destructiveHint=true and idempotentHint=true, so the description's job is to say what is destroyed and why it matters; it does that well by explaining that prior log lines become unreachable and that an empty read may otherwise be misread as buffer rotation. It stops short of stating failure modes (no device attached, permission problems) or whether clearing is device-wide across all apps, which would be the remaining useful behavioral detail.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the action and the adb equivalent, then the rationale, then the alternative — a sensible order with no filler sentences. Minor deduction for editorial framing ('The sharpest isolation primitive') that costs tokens without adding selection information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter, no-output-schema utility, the definition covers effect, workflow role, and the competing option, which is enough to call it correctly. The only gap is scope detail an agent might want (device-wide vs per-app, behavior with zero attached devices).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and the single `serial` parameter is already documented there, including the 'optional when exactly one device is attached' rule. The description adds no further meaning about the parameter, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Empty the device's logcat ring buffer') plus the underlying adb command, which disambiguates it from the sibling `logcat` (read) and `start_logcat_capture`/`stop_logcat_capture` (capture lifecycle). An agent can pick this tool without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit when-to-use pattern — clear, perform ONE action, then read logcat — and names the alternative for the opposite need ('For reaching BACK in time instead, use logcat's since param'). It also explains why the alternative matters (stale filter hits, rotated buffers), so the routing decision is unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.