Skip to main content
Glama
zifanersuotang

Codex Android MCP

Android backtrace

android_backtrace
Destructive

Capture stack traces for an Android app. Dumps all threads via ART's kill -3 from /data/anr/; if permissions block, falls back to logcat crash buffer. Use engine and note to interpret results.

Instructions

Capture stack traces for an app. Asks ART to dump every thread (kill -3, the same mechanism that produces an ANR trace) and reads the newest file from /data/anr/. On most PRODUCTION devices the adb shell user may neither signal another app nor read that directory, so the tool then degrades to the crash log buffer (logcat -b crash) and reports engine:"logcat-crash" — always read engine and note before concluding anything: a logcat-crash result shows the LAST CRASH, not the current stacks, and an empty one means "no crash was recorded", never "the app has no stack". Emulators and rooted/debuggable builds usually get the real engine:"anr-trace".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidNoExplicit pid to signal (from android_processes), overriding package_name resolution.
deviceNoTarget adb serial. Defaults to the streamed device, else the only online one.
all_threadsNoKeep every thread’s stack (default true). false keeps roughly the first thread block, which is usually the main thread.
package_nameNoAndroid package to dump, e.g. "com.example.app". Its pid is resolved with `pidof -s`; when the app is not running only the crash buffer can answer.
Behavior5/5

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

Despite annotations already marking it as destructive and not read-only, the description adds substantial behavioral context beyond those flags. It reveals the exact signal mechanism (kill -3), the dependence on /data/anr/ permissions, the fallback to logcat-crash on production devices, and critical interpretation caveats (logcat-crash shows last crash, empty means no crash, not absence of stacks). This goes far beyond the boolean hints and materially improves an agent's ability to interpret results correctly.

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?

The description is long but every sentence adds value. The core action is front-loaded, followed by the mechanism, the fallback, and crucial interpretation warnings. While verbose, it is not padded; each clause covers a distinct operational or interpretational aspect. The only minor inefficiency is the extended prose on engine and note, but that is essential given the fallback's pitfalls.

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?

With no output schema, the description must convey return structure. It mentions the engine and note fields and warns about logcat-crash semantics, but it does not fully enumerate the output fields or error scenarios. For a stack-capture tool, it provides enough to use and interpret results effectively, though a complete field list would make it exhaustive. The four parameters are all optional and well-covered.

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 description coverage is 100%, so each parameter already has a description. The tool description adds extra nuance: for package_name it explains pid resolution via pidof -s and the behavior when app is not running; for all_threads it clarifies what false does (keeps first thread block, typically main thread). These details enrich parameter understanding beyond the schema, justifying a score above the baseline of 3.

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?

The description opens with a clear, specific verb-resource pair: 'Capture stack traces for an app.' It then details the underlying mechanism (kill -3, ANR trace) and the fallback to logcat-crash, making the tool's purpose unmistakable and distinct from siblings like android_logs or android_meminfo. No ambiguity remains about what this tool does.

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?

The description explains the behavior and degradation but does not explicitly state when to choose this tool over alternatives, nor does it name sibling tools for contrast. It implies usage (when you need stack traces for a running app) but leaves the decision boundary implicit. No explicit 'use this when...' guidance is provided.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zifanersuotang/codex-android-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server