Skip to main content
Glama

断言校验

browser_assert
Read-onlyIdempotent

Verify that a browser step actually worked by checking URL, title, text, selectors, values, console or network, returning pass/fail with expected versus actual values.

Instructions

Verify that what you just did actually worked. Pass one or more checks; each is reported as passed or failed with expected vs actual, and the tool returns isError when any check fails — that is how you distinguish "the click happened" from "the feature works". Supported kinds: url, title, text, selector, count, value, checked, attribute, console, network. match defaults to contains for text-like kinds, equals for count/console, and exists for selector. Use this after every meaningful step of a website test.

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": {
      "checks": "<checks>"
    },
    "name": "browser_assert"
  }
}

Input Schema

NameRequiredDescriptionDefault
tabIdNoTab id (default: active tab)
checksYesAssertions to verify, evaluated in order

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.15.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, open-world behavior, and the description adds real value on top: it says failures surface as isError and that each check reports passed/failed with expected vs actual. That error-signaling contract is exactly the kind of behavior an agent needs and is not in the annotations. It does not describe multi-check evaluation semantics beyond what the schema states.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then the failure-signaling behavior, then the kind inventory and defaults, then the usage instruction — each block earns its place. The kind enumeration is a long inline list, but it is load-bearing since it tells the agent what can be asserted without opening the schema.

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?

With only two top-level parameters, a fully described schema, and no output schema, the description covers what an agent needs: what can be checked, what the defaults are, and how failure is reported. Only the shape of the per-check result payload and evaluation short-circuit behavior remain unspecified, which are minor given the isError contract is stated.

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 goes further by spelling out the concrete default for match per kind family — contains for text-like, equals for count/console, exists for selector — where the schema only says 'default depends on kind'. The tabId parameter and the per-kind filters (level, since, method, status) are left entirely to the schema.

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 opens with a specific verb and object ('Verify that what you just did actually worked') and enumerates the assertable kinds (url, title, text, selector, count, value, checked, attribute, console, network), making the tool's scope concrete. It distinguishes asserting from merely observing through the 'the click happened' vs 'the feature works' framing, but never names a sibling such as browser_page_state or browser_console, so differentiation remains implicit.

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 this after every meaningful step of a website test' gives an explicit, actionable usage trigger, and the click-vs-feature line clarifies the intended role. There is no statement of when not to use it or which sibling to prefer for pure inspection, so it stops short of full routing guidance.

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