Skip to main content
Glama

Assert text

assert_text
Read-only

Verify that expected text appears on a page or within a selected element within a timeout, returning a pass/fail result with the actual text found.

Instructions

Test assertion: PASS if the text is visible on the page (or inside the element matched by selector) within the timeout, otherwise FAIL (isError) with the text that was actually there.

Input Schema

NameRequiredDescriptionDefault
textYesExpected text
exactNoRequire the whole text to match instead of a substring
frameNoCSS selector of the iframe containing the element (e.g. "iframe[name^=__privateStripeFrame]"), or a list for nested iframes, outermost first. Not needed with aria-ref selectors.
labelNoName for this check in the test report, e.g. "Login shows welcome message"
timeoutNoTimeout in milliseconds
selectorNoSelector: "aria-ref=e5" from get_page_snapshot (preferred; also reaches into iframes), CSS ("#email", "button.submit"), text ("text=Sign in"), role ("role=button[name=/save/i]") or XPath ("xpath=//a")

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered. The description adds real value beyond that: it defines the exact outcome (PASS vs FAIL/isError) and discloses that the error surfaces the text actually found, which is critical for an agent interpreting a failed assertion.

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?

One sentence, front-loaded with the PASS condition and immediately followed by the FAIL semantics. Zero filler.

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?

Six parameters with full schema descriptions and no output schema; the description covers the critical return semantics (isError plus actual text) so an agent can interpret results. Minor gaps remain around selector-scoped failure messaging and iframe interplay, but the schema covers those adequately.

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 the baseline is 3, but the description adds semantics beyond the schema: it clarifies that the assertion can be scoped to an element matched by selector and that the timeout governs the wait. It leaves the exact/substring distinction and frame handling entirely to the schema, hence 4 rather than 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb+resource ('Test assertion' on text visibility) and states the full pass/fail semantic explicitly. It does not, however, differentiate itself from the sibling assert_visible or explain why one would assert text rather than element visibility, which keeps it from a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It conveys implied usage (you're asserting expected text after some navigation/action) and the timeout/failure behavior, but gives no explicit when-to-use guidance versus assert_visible or wait_for, nor any exclusions. Context is inferable but not stated.

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