Skip to main content
Glama

Robot Actions — Remote Device Control

android_devtools_evaluate

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

A4.2/5.0
Behavior4/5

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

No annotations are provided, so the description carries the burden. It reveals behavioral traits: enables Runtime, auto-selects the active tab, and returns pageId/pageUrl for verification. It does not mention permissions or side effects, but for a CDP evaluation, these are reasonable to expect.

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 three sentences, each conveying essential information: what it does, how it works, and a caveat about page identity. No filler; front-loaded with the core action.

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?

Given the tool's moderate complexity acceptably complete. It covers the main purpose, the key behavioral nuance (pageId), and the return fields. It doesn't document the output schema (none provided), but for an evaluation tool, specifying result value and exception details is sufficient.

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 parameters are well-documented. The description adds context for pageId (auto-picked when omitted) and the return fields, but does not elaborate on expression syntax or awaitPromise behavior beyond schema defaults.

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 evaluates a JavaScript expression in a page context via CDP, specifying the mechanism (enabling Runtime, calling Runtime.evaluate). It is distinct from siblings like android_devtools_get_dom or android_devtools_elements and identifies the tab context explicitly.

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 explains when to use it (after a navigate, auto-selects the active tab) and gives a hint on when to check results (if they seem from the wrong page). It doesn't explicitly name alternatives like web_evaluate or ios_safari_evaluate, but the context (android_devtools_ prefix) implies device-specific usage.

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