Skip to main content
Glama

eval_script

Evaluate an async IIFE on a connected mobile app to run custom logic and retrieve its result or error, enabling runtime inspection and control.

Instructions

On the connection instance identified by deviceId and appId, evaluate one inline async IIFE and return its result or error with action-scoped evidence. The source must have the form (async () => { ... })().

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appIdYesAndroid package name or iOS bundle identifier.
sourceYesComplete async IIFE source, for example `(async () => { return runtimeStatus(); })()`.
deviceIdYesCanonical ADB serial, CoreDevice identifier, or simulator UDID.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
resultNo
evidenceYesEvidence JSON files, ordered by the first record for each action.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A3.5/5.0
Behavior2/5

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

With no annotations, the description carries the full behavioral burden. It discloses that the tool returns a result or error with action-scoped evidence, but it does not warn that evaluating arbitrary code can have side effects on the device, nor does it state any prerequisites like needing an active connection or running app.

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?

Two concise sentences with no filler. The primary behavior is front-loaded, and the critical source-format constraint is stated immediately after, making the description easy to parse.

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

Completeness3/5

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

The description covers the core invocation details and the output schema exists, but it omits important selection context: when to use this tool instead of call_function, whether a prior connect is required, and potential side effects of executing arbitrary code. This leaves an agent with meaningful gaps for correct tool selection.

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 baseline is 3. The description adds minimal semantic value beyond the schema: it frames deviceId and appId as connection identifiers and repeats the source form that the schema already documents with an example.

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 a specific action: evaluating one inline async IIFE on a connection identified by deviceId and appId, and returning its result or error. The constraint on source form further differentiates it from siblings like call_function, which presumably call named functions.

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?

The phrase 'On the connection instance' implies that a connection must exist and that the device/app must be identified, but it does not explicitly say when to prefer eval_script over call_function or when not to use it. Usage context is implied rather than stated.

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