Skip to main content
Glama

expect

Verify that an action landed as intended or was soft-blocked by checking element state, page text, URL, and challenge walls in one call, returning pass/fail failures.

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 several wait and read calls together. Every check is optional.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "expect"
  }
}

Input 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.2/5.0
Behavior4/5

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

Annotations only declare openWorldHint, so the description carries most of the behavioral disclosure. It adds valuable context: the tool returns a structured {passed, failures[]} verdict, natively detects challenge walls, and treats a wall as failure unless allow_walled is set. It does not discuss waiting/polling behavior or permissions, but the core behavioral contract is clear.

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 front-loaded with the core identity ('ONE-CALL verification gate'), followed by the concrete behavior and usage context. Every sentence contributes meaning, and there is no redundant or filler wording.

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 9-parameter verification tool with no output schema and minimal annotations, the description provides the essential outcome shape and challenge-wall semantics. It does not cover every edge case, such as timeout interaction across checks or session/lease nuances, but those are documented in the schema.

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 explains each parameter in detail. The description adds only a high-level note that every check is optional and names the check categories, which does not materially extend the schema's parameter documentation.

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?

States a specific verb and resource: 'assert the page reached an expected state' and explicitly defines the tool as a composite verification gate combining element-state, page-text, URL, and challenge-wall checks. This clearly distinguishes it from narrow siblings like is_state, wait_url, verify_url, and text.

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?

Gives explicit timing guidance — use after an action to confirm it landed or that the agent got soft-blocked — and contrasts it with stitching together several wait and read calls. It does not name specific sibling tools as alternatives or state when not to use it, which keeps it below a 5.

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