Skip to main content
Glama

ui_check

ui_check

Evaluate a JavaScript expression against the current page to record an observation without failing the test session when it is false. Execution errors or missing pages still cause hard failures.

Instructions

Check a JS expression against the current page WITHOUT failing the session if it is false. Use this for observations you want recorded in the report but which should not condemn the run. If the expression cannot run at all (no page open, or it throws) that is still a hard failure.

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": {
      "condition": "<condition>"
    },
    "name": "ui_check"
  }
}

Input Schema

NameRequiredDescriptionDefault
conditionYesJS expression evaluated in the page context
session_idNoWhich open session to act on, as returned by ui_start_session. Optional with one open session; required when several are open.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With zero annotations, the description carries the full burden and does well: it discloses soft-fail semantics on a false result, the two hard-failure conditions (no page open, expression throws), and that results land in the report. Remaining gap is the return value/result shape on success, which is never described.

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?

Three short sentences, lead sentence front-loads the key differentiator in caps, and the failure-semantics edge case comes last where it belongs. The second sentence partially restates the first ('should not condemn the run'), but adds the report-recording detail, so the redundancy is not pure waste.

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 tool with full schema coverage and no output schema, the definition covers the semantics an agent needs: soft-fail vs hard-fail boundaries and intended usage. Only the shape of the returned result is left unspecified, which is a minor omission here.

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 both `condition` and `session_id` are already documented in the schema. The description adds the useful nuance that the expression runs in page context and that an unrunnable expression is a hard failure, but says nothing about session selection behavior. Baseline 3 is appropriate.

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 action (evaluate a JS expression against the current page) plus its defining property: a false result does NOT fail the session. That contrast immediately separates it from a hard-assertion sibling like ui_assert, so an agent can pick it without reading 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 says when to use it — observations that should be recorded in the report but not condemn the run. The inverse case (use an asserting tool when failure should matter) is strongly implied but no sibling is named, so the routing is clear rather than airtight.

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