Skip to main content
Glama
electron-stagewright

Electron Stagewright

Expect form control value

electron_expect_value
Read-only

Assert element text matches a predicate using equals, contains, regex, or negative variants, polling until condition holds or timeout. Returns matched status and actual value.

Instructions

Assert the value of the element identified by ref or selector matches a predicate, polling until it holds or timeoutMs elapses. Provide exactly one of: equals, contains, regex, not_equals, not_contains. Optional flags (any of i, m, s, u) apply to regex; g and y are rejected as stateful. Returns: { ok, session_id, matched, actual }. Errors: EXPECTATION_FAILED (predicate not met within timeoutMs — details carry expected + actual; retryable), REF_NOT_FOUND (stale ref; carries similar_refs), TRANSPORT_UNSUPPORTED, NOT_RUNNING, BAD_ARGUMENT (no/multiple predicates, invalid regex or flags, or ref+selector both/neither).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoElement ref from a snapshot (resolves to [data-sw-ref="N"]). Provide ref OR selector.
flagsNoOptional regex flags (any of i, m, s, u) applied to the regex predicate; g and y are rejected as stateful. Only valid alongside a regex predicate.
regexNoThe text must match this JavaScript regular expression.
equalsNoThe text must equal this exactly.
containsNoThe text must contain this substring.
selectorNoCSS selector. Provide ref OR selector, not both.
sessionIdNoTarget session id. Omit when a single session is running.
timeoutMsNoMax poll time in ms before EXPECTATION_FAILED (default 5000, clamped to 60000). 0 = check once.
not_equalsNoThe text must NOT equal this.
not_containsNoThe text must NOT contain this substring.
Behavior5/5

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

Annotations already declare readOnlyHint=true, and the description adds rich behavioral details: polling until timeout, the exact error types (EXPECTATION_FAILED, REF_NOT_FOUND, etc.) with their semantics and retryability, and timeout clamping. No contradiction with annotations.

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 a single dense paragraph but front-loaded with the primary purpose. It could be slightly more structured (e.g., bullet points for predicates and errors), but every sentence adds value and there is no redundancy. Slightly lower for readability.

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

Completeness5/5

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

Given the tool's complexity (10 parameters, no output schema), the description sufficiently covers return values (ok, session_id, matched, actual), all error types with conditions, and predicate rules. It is complete enough for an agent to use correctly without additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. However, the description adds significant value beyond the schema: it explains mutual exclusivity of predicates, valid regex flags (rejecting stateful ones), the meaning of timeoutMs=0, and the return format. This is excellent parameter-level guidance.

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 asserts the value of an element against a predicate, with polling. It uses specific verbs ('assert') and resource ('form control value'), and distinguishes well from sibling tools like electron_expect_text or electron_expect_state which handle different checks.

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 specifies that exactly one predicate from a list must be provided, and explains flags for regex. However, it does not explicitly contrast with alternatives like electron_expect_text for text content, leaving some ambiguity about when to use this vs similar tools.

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/electron-stagewright/electron-stagewright'

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