Skip to main content
Glama
Nam0101

android-mcp-toolkit

Take User Screenshot

take-screenshot

Capture an Android device screenshot and save it to a local file. Specify the output path and optional timeout.

Instructions

Capture device screenshot and save to a local file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
outputPathYesLocal path to save the screenshot (e.g. screenshot.png)
timeoutMsNoTimeout in milliseconds

Implementation Reference

  • The handler function that captures a device screenshot by running 'adb exec-out screencap -p', then saves the binary output to the specified local file path.
      async (params) => {
        const buffer = await runAdbCommandBinary(['exec-out', 'screencap', '-p'], params.timeoutMs);
        const absPath = path.resolve(params.outputPath);
        fs.writeFileSync(absPath, buffer);
        return { content: [{ type: 'text', text: `Screenshot saved to ${absPath}` }] };
      }
    );
  • Zod schema defining the input parameters for take-screenshot: outputPath (required string) and optional timeoutMs (1000-20000ms, default 10000).
    const screenshotSchema = z.object({
      outputPath: z.string().min(1).describe('Local path to save the screenshot (e.g. screenshot.png)'),
      timeoutMs: z.number().int().min(1000).max(20000).default(10000).describe('Timeout in milliseconds')
    });
  • Registration of the 'take-screenshot' tool on the MCP server via server.registerTool() with title, description, inputSchema, and handler.
    server.registerTool(
      'take-screenshot',
      {
        title: 'Take User Screenshot',
        description: 'Capture device screenshot and save to a local file.',
        inputSchema: screenshotSchema
      },
      async (params) => {
        const buffer = await runAdbCommandBinary(['exec-out', 'screencap', '-p'], params.timeoutMs);
        const absPath = path.resolve(params.outputPath);
        fs.writeFileSync(absPath, buffer);
        return { content: [{ type: 'text', text: `Screenshot saved to ${absPath}` }] };
      }
    );
  • Helper function that executes an ADB command and returns binary buffer output, used by the screenshot handler to capture raw PNG data.
    async function runAdbCommandBinary(args, timeoutMs) {
      try {
        const { stdout } = await execFileAsync('adb', args, {
          timeout: timeoutMs,
          encoding: 'buffer',
          maxBuffer: 20 * 1024 * 1024
        });
        return stdout;
      } catch (error) {
        throw new Error(`adb ${args.join(' ')} failed: ${error.message}`);
      }
    }
  • src/index.js:30-30 (registration)
    Entry-point call that registers all device tools including 'take-screenshot' on the MCP server.
    registerDeviceTool(server);
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It fails to mention file overwrite behavior, permission requirements, error handling, or what happens on timeout. The minimal description omits critical behavioral traits.

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?

The description is a single, clear sentence that captures the essential action and result without any extraneous words. It is optimally concise.

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

Completeness2/5

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

Despite few parameters and no output schema, the description lacks critical context such as file overwrite policy, timeout behavior, and return value expectation. The tool's behavior is under-described, leaving gaps for agent decision-making.

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 all parameters are described in the schema. The description adds no additional semantic meaning beyond what the schema already provides, leading to a baseline 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 action ('Capture device screenshot') and the output ('save to a local file'), making the tool's purpose unambiguous. It effectively distinguishes this tool from its siblings, which deal with UI hierarchy, input injection, and other device operations.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives, nor are there prerequisites or context about typical use cases. The description solely states what the tool does without any usage advice.

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/Nam0101/android-mcp-toolkit'

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