Skip to main content
Glama

execute_in_app

Execute JavaScript code in React Native apps to inspect app state, run diagnostics, or perform REPL-style interactions with Hermes compatibility.

Instructions

Execute JavaScript code in the connected React Native app and return the result. Use this for REPL-style interactions, inspecting app state, or running diagnostic code. Hermes compatible: 'global' is automatically polyfilled to 'globalThis', so both global.REDUX_STORE and globalThis.REDUX_STORE work.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYesJavaScript expression to execute in the app
awaitPromiseNoWhether to await promises (default: true)
maxResultLengthNoMax characters in result (default: 2000, set to 0 for unlimited). Tip: For large objects like Redux stores, use inspect_global instead or set higher limit.
verboseNoDisable result truncation. Tip: Be cautious - Redux stores or large state can return 10KB+.
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: it executes JavaScript in the app context, returns results, handles Hermes compatibility with global polyfilling, and warns about result truncation for large objects. However, it doesn't mention potential side effects, error handling, or security implications of arbitrary code execution.

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 efficiently structured with two sentences that each serve distinct purposes: the first states the core functionality, the second provides technical details about Hermes compatibility. There's no wasted language, and important information is front-loaded.

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 tool with 4 parameters, 100% schema coverage, but no annotations or output schema, the description provides good contextual completeness. It covers the tool's purpose, usage scenarios, technical compatibility details, and references alternatives. The main gap is the lack of output format description, but given the tool's REPL nature, this is somewhat mitigated by the parameter descriptions.

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 parameters thoroughly. The description adds minimal parameter-specific information beyond the schema - it mentions Hermes compatibility for global/globalThis but doesn't provide additional semantic context for the parameters themselves. This meets the baseline for high schema coverage.

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's purpose: 'Execute JavaScript code in the connected React Native app and return the result.' It specifies the verb ('Execute'), resource ('JavaScript code'), and context ('React Native app'), distinguishing it from sibling tools like inspect_global or get_component_tree which serve different purposes.

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

Usage Guidelines5/5

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

The description provides explicit usage guidelines: 'Use this for REPL-style interactions, inspecting app state, or running diagnostic code.' It also mentions alternatives: 'Tip: For large objects like Redux stores, use inspect_global instead or set higher limit.' This clearly indicates when to use this tool versus other options.

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/igorzheludkov/metro-logs-mcp'

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