Skip to main content
Glama

Click UI outside the passage

click_ui

Clicks dialogs, sidebar buttons, menus by ref, CSS selector, or visible text in Twine games, including label-based options. Returns updated observation; use choose() for numbered passage choices.

Instructions

Click dialogs, sidebar buttons and menus (SAVES, OPTIONS, ModLoader banner, modal buttons) by ref, CSS selector or visible text. Text matching covers -based controls too (SugarCube radio/checkbox options like "Jet black" or "Punch"); shortest match wins, exact=true for exact text. Returns the new observation (text; format:"json" for JSON). Use choose() for numbered passage choices and dialog buttons.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoUI ref from an observation (e.g. "u1" or "x3").
textNoVisible text of the target (case-insensitive, partial match; the shortest match wins).
exactNoRequire an exact text match (default false).
formatNoOutput format: "text" (default, human-readable) or "json" (JSON string for programmatic use).
game_idYesSession id returned by open_game.
selectorNoCSS selector, if you know the exact element.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose meaningful behavior: shortest-match-wins resolution, exact=true semantics, label-based matching, and the return value (the new observation, text or JSON). It does not state side effects, whether the click mutates saved state, or failure behavior when no element matches, which are the remaining gaps.

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?

Dense but front-loaded: the action and target types come first, then matching rules, then the return value, then the sibling routing. Every clause carries information, though the parenthetical control list and the dialog/button phrasing could be tightened slightly.

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?

There is no output schema, but the description states that it returns the new observation and how to request JSON, so return-value handling is covered. For a 6-parameter tool with one required arg and full schema coverage, this is complete enough to invoke correctly, missing only explicit side-effect/failure disclosure.

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 resolution semantics not fully conveyed by the field docs: that text matching also covers <label>-based radio/checkbox options, that the shortest match wins, and that exact=true is opt-in. This is genuine extra meaning beyond the schema.

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 concrete verb (click) plus the exact target classes (dialogs, sidebar buttons, menus, named controls) and the three addressing mechanisms (ref, CSS selector, visible text). It explicitly distinguishes itself from choose(), so an agent can separate it from the closest sibling 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?

It names the alternative (choose()) and the condition that selects it (numbered passage choices and dialog buttons), and explains when text matching applies (label-based SugarCube controls). There is mild ambiguity between 'Click dialogs ... modal buttons' and 'use choose() for ... dialog buttons', but the routing rule itself is explicit.

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