Skip to main content
Glama

Robot Actions — Remote Device Control

Android DevTools evaluate

android_devtools_evaluate
Destructive

Evaluate a JavaScript expression in the context of a page running on the device via CDP. Enables Runtime, then calls Runtime.evaluate. Returns the result value, any exception details, and pageId/pageUrl identifying the tab it actually ran on — check those if a result looks like it came from the wrong page. Omit pageId to auto-select the active tab (after a navigate, that is the tab the navigate landed on).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
udidYesDevice serial number (UDID)
pageIdNoTarget page id from android_devtools_list_pages (auto-picked when omitted)
socketNoAbstract unix socket name (default: chrome_devtools_remote)
expressionYesJavaScript expression to evaluate
awaitPromiseNoWhether to await a returned Promise (default: true)
returnByValueNoReturn the result as a serializable value (default: true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations declare destructiveHint=true, readOnlyHint=false, which the description does not contradict. The description adds valuable behavioral context about what is returned (result value, exception details, pageId/pageUrl) and the pageId auto-selection semantics. It doesn't explain why destruction is possible, but the return-value and tab-targeting details are non-obvious and genuinely useful.

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?

Two tightly packed sentences with no filler. The CDP-mechanics detail is front-loaded, followed by return-value and pageId guidance. Slightly dense but every clause earns its place.

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?

For a CDP evaluate tool with rich annotations and a full schema but no output schema, the description covers the operation, the return shape (result, exceptions, pageId/pageUrl), and the page-targeting rule. Minor gap: it doesn't warn about the destructiveHint or when evaluation could mutate page state, but otherwise complete.

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 the schema already documents all six parameters. The description adds a nuance about omitting pageId (auto-select active tab, post-navigate binding) that enriches semantics beyond the schema's terse note, keeping it above baseline.

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?

States a specific verb (evaluate) and resource (JavaScript expression in a device page via CDP) and names the underlying CDP method call (Runtime.evaluate). Distinct enough from siblings like ios_safari_evaluate and webpage_cdp_command that an agent can select it correctly.

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?

Provides implicit guidance for pageId selection ('omit pageId to auto-select the active tab; after a navigate, that is the tab the navigate landed on'), but does not explicitly contrast with alternatives that could also evaluate JS (webpage_cdp_command, session_execute) or specify when to prefer this tool.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources