Skip to main content
Glama

Diagnose the Android toolchain

android_doctor
Read-onlyIdempotent

Diagnose Android build and device failures by validating adb, SDK, JDK, and connected devices, then report exact issues and fixes.

Instructions

Check that the Android toolchain is usable and report exactly what is wrong when it is not.

Verifies adb, the SDK, the JDK, and connected devices; with a project path it also checks that project's Gradle wrapper against the JDK that would be used to build it — the mismatch that produces 'Unsupported class file major version'.

Run this first when a build or device command fails for a reason that is not obviously in the app's own code.

Args:

  • project_path (string, optional): Gradle root to include in the checks

  • module (string): module to inspect (default: 'app')

  • response_format ('markdown' | 'json')

Returns: { "healthy": boolean, "checks": [ { "name": string, "status": "ok"|"warn"|"fail", "detail": string, "fix": string } ], "toolchain": { "adb": string, "sdkRoot": string, "javaHome": string, "javaMajor": number } }

Examples:

  • Use when: a build fails and you do not yet know whether the cause is the project or the environment

  • Use when: adb commands fail and you want to know if the device is authorized

  • Use when: setting up on a new machine and want to confirm everything resolves

Error Handling:

  • Reports missing adb as a failed check with installation guidance, rather than throwing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
moduleNoModule to inspect.app
project_pathNoGradle root to include in the diagnosis.
response_formatNoOutput format: 'markdown' for human-readable, 'json' for machine-readable.markdown
Behavior5/5

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

Given annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true, the description adds substantial behavioral detail: it enumerates the components verified (adb, SDK, JDK, devices, Gradle wrapper), explains the specific JDK mismatch it catches, and describes error handling (reports missing adb with guidance rather than throwing). No contradictions with annotations.

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 longer than average but well-structured with clear sections (overview, args, returns, examples, error handling). The opening sentence is immediately informative. Minor redundancy exists between the 'Run this first' guidance and the later 'Use when' examples, but all sections serve a purpose.

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?

For a multi-check diagnostic tool with no output schema, the description is thorough: it explains what is checked, when to use it, the return object structure with example entries, and error behavior. It even names a specific failure mode ('Unsupported class file major version'). This gives an agent everything needed to invoke and interpret the tool correctly.

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 coverage is 100%, so the baseline is 3. The description's 'Args' section largely restates the schema's parameter descriptions (e.g., project_path as 'Gradle root to include in the checks'), adding little new meaning. It does not explain parameter interactions or edge cases beyond what the schema already provides.

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 specific action ('Check that the Android toolchain is usable') and a clear deliverable ('report exactly what is wrong'). It distinguishes itself from sibling tools by positioning itself as the first diagnostic step when build or device commands fail.

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?

The description provides strong contextual guidance: 'Run this first when a build or device command fails for a reason that is not obviously in the app's own code' and gives three concrete 'Use when' examples. It lacks explicit when-not-to-use or alternative tool names, but the context is clear enough to guide selection.

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/jjs03111/android-build-mcp'

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