Skip to main content
Glama
smk-h

embedded-mcp-toolkit

by smk-h

adb_shell_exec

Send a command to an open ADB shell session and capture the output in one call. Set a timeout that matches the task and wait for completion before issuing the next command to avoid interleaved results.

Instructions

Send a command to an ADB shell session and wait for the output. Combines write + delay + read in one call. IMPORTANT: Do NOT issue concurrent commands to the same session_id — the ADB shell is a single channel; concurrent calls will interleave output and corrupt results. Always wait for the previous command to finish before sending the next one. If you need parallel execution, open multiple sessions via adb_shell_open.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clearNoBuffer clear flag: 1 (default) = clear buffer before collecting, 0 = append to buffer
delayNoMinimum polling duration in milliseconds (default: 1000), kept for backward compat
commandYesThe command to send to the shell
session_idYesThe session ID returned by adb_shell_open
maxDurationNoExecution cap in ms — ALWAYS estimate and pass a timeout matching the command's expected runtime; do not omit it. Suggested ranges: instant info commands (ls/ip addr/cat/echo) 3000-5000; medium tasks (apt install, dd, service restart) 30000-120000; long builds/flashes (make, flash_image) up to 600000; streaming/resident commands (ping/logcat/top, or sampling a fixed window of live output) 10000 (Ctrl+C auto-sent to stop). If omitted, safety-valve defaults apply: resident commands 10000ms (sampling, Ctrl+C sent on timeout), other commands 300000ms (5min fallback, NO interrupt sent — the command may still be running, terminate via send_ctrl if needed). Timeout type is annotated in the returned output.
Install Server

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries full transparency responsibility. It discloses the single-channel concurrency risk, the combined write+delay+read behavior, and detailed timeout semantics including Ctrl+C handling for resident commands. This goes beyond mere functionality and addresses practical safety concerns.

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 thorough but not bloated. The core purpose is stated first, followed by a crucial warning, then an alternative, and finally detailed timeout guidance. Each section earns its place, though the maxDuration explanation could arguably be trimmed without losing essential information.

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?

Given no output schema and no annotations, the description is remarkably complete. It explains the operation, concurrency constraints, timeout behavior, and parameter nuances, ensuring an agent can use the tool safely and effectively without needing external context. No critical gaps are apparent.

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 100%, so baseline is 3. The description adds critical semantics for maxDuration (always pass a timeout, suggested ranges, fallback behavior), which is not present in the schema. Other parameters are already well described, but the extra guidance for maxDuration elevates the score.

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 clearly states the tool sends a command to an ADB shell session and waits for output, combining write/delay/read. It distinguishes from siblings like adb_shell_write and adb_shell_read by explaining the combined behavior, and mentions alternatives like adb_shell_open for parallel sessions.

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

Usage Guidelines5/5

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

The description explicitly warns against concurrency on the same session and instructs to wait for previous commands, with a clear alternative (open multiple sessions). It also provides guidance on timeout estimation via maxDuration, making usage expectations concrete.

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

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/smk-h/embedded-mcp-toolkit'

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