Skip to main content
Glama

webview_eval

Evaluate JavaScript expressions in iOS app WebViews to read app state or assert conditions against the live DOM.

Instructions

Evaluates a JavaScript expression in a WebView's page context and returns the result. Use it to read web-app state (location.href, store values, feature flags, on-screen balances) or to assert conditions against the live DOM. Requires the app's WKWebView to be inspectable (isInspectable=true) — on by default in debug/staging builds, frequently disabled in production App Store builds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
udidYesSimulator / device UDID
expressionYesJavaScript expression to evaluate, e.g. "location.href" or "document.querySelectorAll('button').length"
webviewIdNoTarget WebView id. Omit to auto-select the first visible WebView.
Behavior3/5

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

No annotations are provided, so the description carries full burden. It states that the tool evaluates JS and returns results, and warns about inspectability requirements. However, it does not disclose potential side effects of JS evaluation, error handling, or whether the operation is synchronous. This is adequate but leaves some behavioral ambiguity.

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 succinct yet informative, consisting of two sentences that front-load the core functionality and then provide context on when it works. No extraneous text.

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 absence of an output schema, the description clarifies that the tool 'returns the result' and gives examples of use cases. It covers the key aspects of what the tool does and its limitations (inspectability). A minor gap is not describing error behavior for invalid expressions, but overall it is fairly 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?

The input schema covers all three parameters with descriptions, so schema coverage is 100%. The description does not add significant parameter-level detail beyond the schema, but it does provide example expressions which help illustrate usage. Baseline score of 3 is appropriate.

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 verb ('Evaluates') and resource ('JavaScript expression in a WebView's page context'). It provides specific examples like location.href and DOM queries, and the tool is clearly distinguished from siblings such as webview_navigate and webview_inspect.

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 the tool ('read web-app state' or 'assert conditions against the live DOM') and notes a critical prerequisite (inspectable WKWebView) with context about build variants. It does not explicitly mention alternatives but the sibling list provides context.

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/hoainho/podium-mcp'

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