Skip to main content
Glama

debugger-evaluate

Execute JavaScript in the app runtime to read state, call functions, and test logic. Returns results as JSON with device context.

Instructions

Execute arbitrary JavaScript in the app's JS runtime via CDP — Hermes on iOS / Android / Vega, V8 on Chromium. Returns the evaluation result as a JSON-serializable value, along with deviceName, appName, and logicalDeviceId for context. Use when you need to read app state, call app functions, or test logic at runtime. The result is serialized by value, so cyclic objects (many RN runtime values — fiber nodes, navigation refs, global — are cyclic) fail with a serialization error rather than returning silently. Fails if the expression throws or the runtime is not connected.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portNoMetro server port (ignored for Chromium)
device_idYesDevice id from list-devices — the SAME id you passed to debugger-connect (iOS simulator UDID, Android serial, Vega serial, or Chromium device id). The logicalDeviceId debugger-connect returns also resolves here, but prefer the stable list-devices id.
expressionYesJavaScript expression to evaluate in the app runtime
Behavior4/5

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

With no annotations, the description carries full burden. It details runtime environments (Hermes, V8), that results are serialized by value, that cyclic objects cause a serialization error (not silent), and that evaluation fails if the expression throws or runtime is not connected. It does not explicitly clarify whether evaluation is read-only or can have side effects, but the caveats are 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?

The description is two paragraphs: first states purpose and return, second lists caveats. It is front-loaded with the main verb and resource. Slightly lengthy but no wasted words, and all information is relevant.

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 three parameters and no output schema, the description covers return value (JSON-serializable plus deviceName, appName, logicalDeviceId) and failure modes. It does not mention expression length limits, timeouts, or security restrictions, but for a development tool this is sufficient. Sibling tools are not compared, but overall completeness is adequate.

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 description coverage is 100%. The description adds value beyond the schema: for device_id it clarifies it is the same id from list-devices or debugger-connect, preferring list-devices. For port, it notes it is ignored for Chromium. Expression parameter description is redundant with schema but consistent.

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 executes arbitrary JavaScript in the app's runtime via CDP, specifying the engine per platform (Hermes on iOS/Android/Vega, V8 on Chromium). It lists specific use cases: read app state, call functions, test logic, and describes the return value. This distinguishes it from sibling tools like debugger-status or debugger-component-tree.

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 provides usage guidance: 'Use when you need to read app state, call app functions, or test logic at runtime.' It also mentions limitations (cyclic objects fail). However, it does not explicitly state when not to use this tool or suggest alternatives among the many sibling tools, which would improve clarity.

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/software-mansion/argent'

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