Skip to main content
Glama

read_logcat_smart

Diagnose Android app issues by reading Logcat filtered by package PID, tag, keyword, or level, and extract crash stack traces.

Instructions

【智能 Logcat 诊断工具】支持按包名自动绑定进程 PID、一键提取闪退堆栈 (crash_only=True)、按 Tag 或关键词精准过滤日志。

Input Schema

NameRequiredDescriptionDefault
tagNo按 Log Tag 过滤(如 'MapAdKiller'、'AndroidRuntime')
levelNo最低日志级别:'V', 'D', 'I', 'W', 'E', 'F',默认 'I'I
linesNo返回的最新日志行数,默认 100
packageNo按应用包名自动解析 PID 过滤日志(如 'com.example.app')
crash_onlyNo是否仅读取崩溃缓冲池 (logcat -b crash),查闪退必开!默认 False
clear_firstNo是否清空旧日志缓冲池 (logcat -c),默认 False
grep_keywordNo按正文中包含的关键词过滤

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the burden, and it does disclose non-obvious behavior: automatic PID resolution from a package name and the switch to the crash ring buffer. However, it never warns that clear_first wipes the log buffer — a destructive side effect only visible in the schema — and says nothing about permissions or device prerequisites. The presence of an output schema excuses it from explaining return values.

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?

A single bracketed label followed by one dense sentence that front-loads the core capability and then lists the three distinguishing modes. Nothing is padded, though the bracketed Chinese tagline duplicates the tool name rather than adding information.

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

Completeness3/5

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

For a seven-parameter, fully optional tool with an output schema, the description covers the main operating modes adequately. What it omits is material: the destructive nature of clear_first, any guidance on combining filters, and any differentiation from the generic adb/shell siblings that could also read logs.

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%, so every one of the seven parameters is already documented in structured form, which sets the baseline at 3. The description restates a few of them (package-based PID binding, crash_only, tag/keyword filtering) without adding format, precedence, or interaction rules — e.g. what happens when both package and grep_keyword are set.

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

Purpose4/5

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

The description names a specific resource (Logcat) and three concrete capabilities: automatic PID binding by package name, one-click crash stack extraction via crash_only=True, and filtering by Tag or keyword. An agent can tell this is a filtered log-read tool, not a generic shell or adb wrapper, even though no sibling (e.g. adb_command, shell_execute) is named as an alternative.

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

Usage Guidelines3/5

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

Usage is only implied: the mention of crash_only=True for 闪退 (crash) investigation hints at the crash-diagnosis scenario, but there is no explicit when-to-use statement, no when-not-to-use, and no routing to alternatives such as adb_command or shell_execute for raw logcat access. The agent must infer the context from the feature list.

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