Skip to main content
Glama

Logcat

logcat
Read-only

Dumps recent Android native log lines, filtered by time, tag, priority, or substring, to reveal the root cause behind generic failure alerts.

Instructions

Dump recent native log lines — the last N (default 400) or, with since="2m"/"90s", everything from that long ago on the device clock (the right axis when the report is 'I just hit an error'; on a chatty emulator 400 lines can span seconds). Optionally filtered by a case-insensitive substring, a minimum priority (V/D/I/W/E/F — e.g. priority="E" for errors and up), and/or tags (OR'd). This is how you find the REAL reason a native call failed when the UI only shows a generic 'X failed' alert: filter by your app tag or 'Exception'/'Caused by' and read the 'Caused by:' line — that is the root cause. Dumps and exits (does not stream); chatty spam is stripped.

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": "logcat"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagsNoKeep only lines whose log tag contains one of these (case-insensitive, OR'd), e.g. ["SessionStore","AuthModule"]. Omit for no tag filtering.
linesNoNumber of recent lines to dump. Default 400. Ignored when since is given.
sinceNoTime window instead of a line count: only lines from the last e.g. "2m", "90s", "1h30m" (device clock). The right axis when the report is "I just hit an error" — on a chatty emulator 400 lines can span under ten seconds.
filterNoCase-insensitive substring to keep (e.g. an app tag or "Exception").
redactNoMask common secrets (token, password, authorization, api key, secret) before returning log lines. Recommended for payment/auth SDKs and debug builds.
serialNoTarget device serial (adb -s). Optional when exactly one device is attached.
priorityNoMinimum priority to keep: V, D, I, W, E, or F (matches adb's own "*:E"-style filter — E keeps Error and Fatal). Omit for no priority filtering.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already establish readOnlyHint=true and openWorldHint=false, so safety is covered; the description adds genuinely behavioral facts beyond that — it terminates rather than streams, defaults to 400 lines, strips chatty spam, and uses the device clock for since windows. It stops short of describing pagination/truncation behavior when the dump is large, so a 4 rather than 5.

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 core behavior, then the diagnostic use case, then the termination caveat — a sensible order. It is on the long side and repeats the "chatty emulator / 400 lines can span seconds" point that also appears in the since schema field, which is a small redundancy rather than a real flaw.

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

Completeness5/5

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

Seven optional parameters, no output schema, and thin annotations — the description carries the load well, covering selection strategy, filter composition, redaction expectations, and the fact that output is a finite dump. An agent has everything needed to call it correctly on the first try.

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

Parameters4/5

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

Schema coverage is 100%, so the per-parameter baseline is 3. The description still adds cross-parameter meaning the schema only implies: lines is ignored when since is supplied, tags are OR'd while filter/priority narrow further, and the rationale for choosing since over lines on a chatty emulator.

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?

Opens with a specific verb+resource ("Dump recent native log lines") and immediately bounds scope with the two selection axes (last N lines or since-based window). It also distinguishes itself from the streaming siblings by stating "Dumps and exits (does not stream)", so an agent can separate it from start_logcat_capture/stop_logcat_capture without inspecting other schemas.

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

Usage Guidelines4/5

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

Gives a concrete when-to-use scenario ("when the UI only shows a generic 'X failed' alert") and a concrete recipe (filter by app tag or 'Exception'/'Caused by', read the Caused by line). The non-streaming clause implicitly routes streaming needs elsewhere, but no sibling tool is named explicitly, which keeps it short of a 5.

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