Skip to main content
Glama

logcat

Read-only

Retrieve recent Android log lines filtered by app, tag, priority, time, and JavaScript regex to debug app issues; switch to follow mode for streaming logs while reproducing bugs.

Instructions

Recent Android log lines, filtered by app, tag, priority, time and regex. Android's clock is UTC. For logs that keep coming, such as while you reproduce a bug, use logcat_follow.

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
grepNoJavaScript regular expression a line must match.
tagsNologcat filter specs such as "ActivityManager:I" or "chromium:V"; tags not listed are hidden.
linesNoReturn at most the last N matching lines.
buffersNo
packageNoOnly lines logged by this app's uid. System apps such as Settings share uid 1000 with system_server.
since_sNoOnly lines from the last N seconds.
min_priorityNoLowest priority shown, for every tag not in tags.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the safety profile is covered; the description adds a non-obvious behavioral fact that Android's clock is UTC, which affects how timestamped lines are read. It does not describe ordering of returned lines, truncation behavior when the buffer is short, or cost of wide greps, so it is good but not rich.

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?

Two sentences with zero filler: the first front-loads what the tool returns and how it can be narrowed, the second routes the agent to the alternative. Nothing in it is redundant enough to cut.

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 7-parameter, all-optional read tool with no output schema, the description covers scope, filter dimensions, the UTC clock caveat and the streaming alternative. It leaves the return shape (line ordering, whether headers or buffer labels are included) and default behavior with no filters unstated, which is a modest gap rather than a blocking one.

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 86%, so the schema already explains grep, tags, lines, buffers, since_s and min_priority in detail. The description mostly restates those axes ('filtered by app, tag, priority, time and regex'); the UTC note is the only genuine semantic addition, and it is only loosely tied to since_s. Baseline 3 applies when the schema does the heavy lifting.

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?

Expands the terse name 'logcat' into a specific resource and scope: 'Recent Android log lines', and enumerates the filter axes (app, tag, priority, time, regex). It also explicitly distinguishes itself from the streaming sibling logcat_follow, so an agent can pick between them without opening either 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 an explicit routing rule with a concrete scenario: continuous logs, e.g. while reproducing a bug, belong to logcat_follow. It stops short of stating prerequisites (device connectivity, adb/root access) or when this finite snapshot is the wrong choice for other adjacent needs, so it is clear but not fully exhaustive.

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