Skip to main content
Glama

expect

Verify page state after an action by checking element, text, URL, and challenge-wall conditions in a single call.

Instructions

ONE-CALL verification gate. Assert the page reached an expected state — composes element-state / page-text / URL checks plus a native challenge-wall check into a single {passed, failures[]} verdict. Use after an action to confirm it landed (or that you got soft-blocked) instead of stitching wait/text/url/screenshot calls. Every check is optional.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
leaseNoOptional lease token to present if the target session is leased (0.7.0). Threaded per-call; never read from the server's env.
stateNoExpected element state (default 'visible'): visible|hidden|attached|detached.
targetNoElement to assert — @eN / @text: / @label: / CSS.
sessionNoOptional session name to target (omit for the shared 'default'). On a daemon shared with other agents, pass a UNIQUE name for stateful multi-step work (go→click→fill) so you don't collide on 'default'.
screenshotNoauto = capture only on failure (evidence); always; never.auto
timeout_msNoPer-wait budget.
allow_walledNoIf false (default), a detected Cloudflare/DataDome challenge wall is a failure.
url_containsNoCurrent URL must contain this substring.
text_containsNoPage text must contain this substring.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

The description discloses the composite nature and the challenge-wall check, and it mentions the return verdict shape. With only openWorldHint as an annotation, it adds meaningful behavioral context (e.g., it composes waits and checks, not just reads state). It doesn't go into side effects like timeout waits or screenshots, but those are already captured in the schema params, so this is adequate.

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?

Three dense sentences with zero fluff. The purpose and usage are front-loaded, and the return format is stated compactly. Every sentence earns its place, and the description is immediately scannable.

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 adequately explains the return format ({passed, failures[]}) and provides usage context. It covers the main use case (post-action verification) and the soft-blocked case. Minor gaps remain (e.g., no explicit mention of default timeout or screenshot auto behavior), but those are covered by the parameter schema, so the overall picture is 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?

Schema coverage is 100%, and the description does not add substantive meaning beyond what the input schema provides. It mentions that every check is optional, but that is already implied by all parameters being optional in the schema. No additional syntax or interplay details are explained.

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 states a precise verb ('Assert') with a specific resource ('the page reached an expected state') and lists the composed checks (element-state, page-text, URL, challenge-wall). It clearly distinguishes itself from sibling tools like is_state (single state check) and verify_url (URL only) by framing itself as a composite one-call gate.

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?

Explicitly tells when to use it ('Use after an action to confirm it landed') and what to avoid ('instead of stitching wait/text/url/screenshot calls'). It even handles the soft-blocked case, making the decision boundary crisp for the agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.