Skip to main content
Glama

adb_logcat

Read-only

Snapshot a connected Android device's logcat buffer. Returns recent lines with optional filters to reduce noise before raising the line count.

Instructions

Dump the device's current logcat buffer and return its most recent lines - a snapshot, not a live stream, and it doesn't clear the buffer. Only reads. Returns { lineCount, truncatedFrom, lines } where lines is an array of raw log lines, lineCount is how many are returned, and truncatedFrom is the total lines in the dump before trimming. Use filter to cut noise (e.g. one app's tag) before raising lines. Requires adb on PATH and an authorized device.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
linesNoHow many of the most recent lines to return. Default 200.
filterNoSpace-separated logcat filterspecs, e.g. "MyTag:D *:S" shows only MyTag at debug level and above and silences everything else. Omit for the whole buffer.
workspaceNoWorkspace name (not id). Created if it doesn't exist, and this call is recorded as a job in its history. Defaults to "default".
deviceSerialNoDevice serial from adb_devices, e.g. "emulator-5554" or "R58M123ABC". Only needed when more than one device is connected; omit otherwise.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.3.7
    • addedInput schema / properties / deviceSerial / description
      Added value: +"Device serial from adb_devices, e.g. \"emulator-5554\" or \"R58M123ABC\". Only needed when more than one device is connected; omit otherwise."
    • changedInput schema / properties / filter / description
      Previous value: -"logcat filterspec, e.g. \"MyTag:D *:S\""New value: +"Space-separated logcat filterspecs, e.g. \"MyTag:D *:S\" shows only MyTag at debug level and above and silences everything else. Omit for the whole buffer."
    • addedInput schema / properties / lines / default
      Added value: +200
    • changedInput schema / properties / lines / description
      Previous value: -"How many lines to tail, default 200"New value: +"How many of the most recent lines to return. Default 200."
    • addedInput schema / properties / lines / minimum
      Added value: +1
    • changedInput schema / properties / workspace / description
      Previous value: -"Workspace name (not id) - created automatically if it doesn't exist yet. Defaults to \"default\"."New value: +"Workspace name (not id). Created if it doesn't exist, and this call is recorded as a job in its history. Defaults to \"default\"."
  2. First observedv1.3.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnlyHint, openWorldHint) by disclosing that the call does not clear the buffer, that the result is a point-in-time snapshot rather than a stream, and that it requires adb on PATH and an authorized device. These are real operational prerequisites an agent cannot infer from structured fields.

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

Conciseness5/5

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

Front-loads the core action, then attaches the snapshot/non-destructive caveats, the return shape, a usage tip, and prerequisites in a tight sequence. Every sentence carries distinct information with no padding.

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?

With no output schema, the description fully specifies the return object (lineCount, truncatedFrom, lines) and its semantics. Combined with prerequisites and non-destructive behavior, an agent has everything needed to invoke this correctly.

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 already 100%, so the schema carries parameter documentation. The description still adds value by explaining the interaction between filter and lines ('cut noise before raising lines') and by describing the shape of the returned line array, exceeding the baseline for a fully-covered schema.

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 ('Dump the device's current logcat buffer and return its most recent lines') and immediately scopes it as a snapshot rather than a live stream. This distinguishes it from the generic adb_shell sibling without the agent needing to open a schema.

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 actionable guidance: 'Use filter to cut noise (e.g. one app's tag) before raising lines,' which tells the agent how to sequence the two parameters. It also clarifies snapshot semantics. However, it never explicitly contrasts this tool with adb_shell or names an alternative, so it stops short of full when/when-not routing.

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