Skip to main content
Glama

run_assertion

Checks a condition on the current page and reports PASS or FAIL, enabling automated verification of Chrome extension behavior.

Instructions

Run a test assertion against the current page. Checks a condition and reports PASS or FAIL.

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": {
      "description": "<description>"
    },
    "name": "run_assertion"
  }
}

Input Schema

NameRequiredDescriptionDefault
scriptNoJS expression that must return true to pass (overrides selector)
selectorNoCSS selector to check existence or text content of
descriptionYesHuman-readable description of what is being tested
expected_textNoExpected text content of the element (optional, used with selector)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.4.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden, and it does disclose the key behavioral trait that the tool reports a PASS/FAIL verdict rather than remaining silent. However it does not say what a FAIL means at the tool level (returned verdict vs. raised error), whether the assertion aborts a test run, or what happens when neither script nor selector is supplied.

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?

Two short sentences, front-loaded with the action and followed by the result semantics; no wasted wording. Slightly redundant since "assertion" already implies a pass/fail check, but the second sentence still adds the explicit output contract.

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 no output schema and no annotations, the description covers the essential contract: it evaluates a condition on the current page and yields a verdict. It is a little thin on failure semantics and on how the assertion fits into a broader test flow, but nothing an agent needs in order to call it correctly is missing.

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 four parameters are already well documented in the schema, including the script/selector override relationship. The description adds no parameter-level meaning beyond that, which is the expected baseline when the schema does the work.

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?

"Run a test assertion against the current page" gives a specific verb and target scope, and "reports PASS or FAIL" pins the outcome shape. It is clearly distinguishable from sibling inspection/tooling names, but it never explicitly contrasts itself with alternatives such as inspect_dom, so it stops short of 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 Guidelines2/5

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

There is no statement of when to use this versus alternatives, no prerequisites (e.g. that a page must be loaded or a browser connected), and no note on what to do if no page is active. Usage is only inferable from the phrase "against the current page".

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