Skip to main content
Glama

ui_select_option

ui_select_option

Select an option in a single by value or visible label, or pick exactly one option in a using the selector from ui_get_page_state.

Instructions

Choose an option of the single matching the selector, by option value or visible label. For a this selects exactly that one option. Use the selector from ui_get_page_state. Selectors containing "nth=" are positional: call ui_get_page_state again after the page changes before reusing them.

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>",
      "value": "<value>"
    },
    "name": "ui_select_option"
  }
}

Input Schema

NameRequiredDescriptionDefault
valueYesThe option's value attribute or its visible label
selectorYesCSS selector, or the `selector` value of an element from ui_get_page_state, passed unchanged
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.4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and does disclose the key behavioral traits: on a <select multiple> only that one option is selected (not additive), the selector is acted on unchanged, and positional selectors go stale after page changes. It does not say what happens when no option matches (error vs. no-op) or whether change events fire.

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 sentences, front-loaded with the core action, then edge-case behavior, then the prerequisite about selector provenance. Every sentence adds information and nothing is repeated from 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?

For a 3-parameter mutation-style UI tool with no annotations and no output schema, the definition covers the important setup (session-scoped, selector source), the multi-select nuance, and selector staleness. Missing only the failure/edge behavior when no matching option exists.

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 baseline is 3; the description still adds meaning by clarifying that `value` may be either the value attribute or the visible label in a single field, and by explaining how `selector` values relate to ui_get_page_state output and positional `nth=` forms.

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 (choose an option) and resource (a single <select> matched by selector), with the lookup key (value attribute or visible label) spelled out. The single vs. multiple select distinction makes it clearly distinct from generic actions like ui_click or ui_fill.

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 routes the agent to ui_get_page_state for the selector value and warns that positional `nth=` selectors must be re-fetched after the page changes. It does not state when to prefer this over ui_click on an option element, so one alternative is left implicit.

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