Skip to main content
Glama

assert_text

Read-onlyIdempotent

Verify that a web element contains expected text using a substring match and return PASS or FAIL without throwing errors, so browser automation checks can continue without breaking flow.

Instructions

[Agent Browser] Check if an element contains expected text (substring match). Returns [PASS]/[FAIL] in message - never throws. Use for verification without breaking flow. Returns data.found (bool) and truncated data.text (max 500 chars with context).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "selector": "<selector>",
      "expected": "<expected>"
    },
    "name": "assert_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
expectedYes
selectorYes

Output Schema

NameRequiredDescriptionDefault
dataNo
hintsNo
messageNo
successNo
suggestionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive, closed-world behavior, so the description's value is in what it adds: 'never throws' and the [PASS]/[FAIL] message convention disclose failure semantics that the annotations do not. The data.found/truncated data.text details are useful but partly redundant with the existing output schema.

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 short lines, front-loaded with the core action, then behavior, then return shape. No filler sentences and no repetition of the tool name or title.

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 two-parameter assertion tool with full annotations and an output schema, nearly everything an agent needs is present: matching mode, non-throwing behavior, and return shape. The only meaningful gap is the selector format, which is unaddressed in both schema and description.

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 0%, so the description must carry parameter meaning; it clarifies that 'expected' is a substring rather than an exact match, which is genuinely useful. However, it says nothing about what form 'selector' takes (CSS, XPath, text selector), leaving one of two required parameters ambiguous.

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 ('Check if an element contains expected text') and pins down the matching mode ('substring match'), which is exactly what separates it from siblings like assert_visible, assert_url, and wait_for_text. An agent can identify the tool's job without opening the 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?

'Use for verification without breaking flow' gives clear situational context and implicitly contrasts it with asserting calls that might throw or interrupt execution. It does not name an explicit alternative or state when not to use it, so it falls short of a 5.

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