Skip to main content
Glama

assert

Read-onlyIdempotent

Verify page conditions by polling until timeout: check element presence, visibility, count, text, URL, or title. Fails with a clear mismatch error for test replay.

Instructions

Assert a page condition, polling until timeout: element exists/visible (optionally with count or containing text), text on page, tab url/title. Patterns: substring, or "/…/" for regex. Recorded flows replay it as a test. Unlike wait_for, which returns found: false, a failure is an error naming what did not match; success returns passed and waited_ms.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoTab url pattern
textNoIn the element (with selector) or anywhere on the page
countNoExact match count for selector
stateNoattached means present in the DOM, visible also requires a rendered boxattached
titleNoTab title pattern
tab_idNoTarget tab; omitted = last tab navigated in this session, else the active one
timeoutNoMax ms to wait for the condition before failing
selectorNoElement the assertion is about; ">>>" pierces shadow DOM

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.10.0
    • addedInput schema / properties / selector / description
      Added value: +"Element the assertion is about; \">>>\" pierces shadow DOM"
    • addedInput schema / properties / state / description
      Added value: +"attached means present in the DOM, visible also requires a rendered box"
    • addedInput schema / properties / tab_id / description
      Added value: +"Target tab; omitted = last tab navigated in this session, else the active one"
    • addedInput schema / properties / timeout / description
      Added value: +"Max ms to wait for the condition before failing"
  2. First observedv1.8.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the bar is lower, and the description adds valuable behavioral detail: it polls until timeout, failure raises an error naming the mismatch, and success returns passed and waited_ms. This is useful since no output schema exists, though polling cadence and partial-match failure specifics are not covered.

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 tight sentences, front-loaded with the core verb and polling behavior, followed by pattern syntax and the sibling contrast. No filler; every clause carries information an agent needs.

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 an 8-param, output-schema-less tool, the description covers the essential behaviors: polling, failure semantics, and the shape of success/failure responses, with annotations covering safety. It is close to complete, missing only finer details like default timeout behavior and multi-condition interactions.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds meaning beyond the schema by explaining the pattern syntax (substring vs "/…/" regex) and clarifying that count/containing-text are optional modifiers. These are not stated in the schema field descriptions and improve correct invocation.

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 ('Assert') and resource ('a page condition'), then enumerates the condition types (element exists/visible, text, url/title) so the agent knows exactly what can be tested. It also names and contrasts the sibling wait_for, making differentiation possible without opening either schema.

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?

Explicitly frames the when: recorded flows replay it as a test, and contrasts behavior with wait_for (which returns found:false vs this erroring). This gives a clear selection rule against the closest alternative, though it stops short of stating exclusions for each condition type.

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