Skip to main content
Glama

screen.setValue

screen_setValue

Sets Switch, Slider, Picker, or SegmentedControl values in a running React Native/Expo app, waits for render, then reads back the displayed value to confirm acceptance and warn on refusals.

Instructions

Set a Switch, Slider, Picker or SegmentedControl: calls its onValueChange (and a Slider's onSlidingComplete) with the value, waits for the render and reads the value back. A Switch takes true or false, a Slider a number within minimumValue and maximumValue (0 and 1 by default) and on its step (onSlidingStart, onValueChange, onSlidingComplete), a Picker one of its Picker.Item values, a SegmentedControl one of its values (a wrong type or value is an error that lists the options). The reply has value as the app now shows it, and a warning when that is not what was set (a controlled value the app refused). Disabled controls are refused; {force:true} sets anyway. {scroll:true} scrolls or pages the target into view first (pages the largest vertical list; onEndReached may fire). target is a string (testID, label, placeholder or text) or an object that must match every key it sets: {testID, label, placeholder, text, at:[x,y], index}. Unknown keys are errors. {at:[x,y]} hits the smallest element covering that point, for icon-only buttons with no label. Several matches: add an index, either in the target or as a trailing {index:n} argument.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "screen_setValue"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNoThe tool's arguments, in order (each any JSON value). Leave out for none.
fullNoReturn a result over 32 KB whole instead of a summary of its size and shape.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.2

TDQS

A4.6/5.0
Behavior5/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 so thoroughly: it discloses the callback sequence, the render wait, read-back verification, the reply shape (`value` plus a warning when the app refused a controlled value), that disabled controls are refused unless forced, and that {scroll:true} may trigger onEndReached. It also flags error behavior for unknown keys and out-of-range values.

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?

The content is dense and front-loaded with the core action before branching into per-type rules and modifiers, and nearly every sentence carries actionable information. It is written as one long run-on paragraph, which makes it harder to scan than a partitioned structure would be.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, and the description nevertheless explains what the reply contains (`value` and a mismatch warning), which is exactly what an agent needs for a verify-after-set tool. Combined with its coverage of force, scroll, indexing and error cases, nothing essential is missing for correct invocation.

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?

The input schema is a generic positional `args` array and a `full` flag, so the schema alone conveys almost nothing about the real arguments; the description compensates by defining target forms (string vs object with testID/label/placeholder/text/at/index), the {force}, {scroll} and trailing {index:n} modifiers, and the unknown-key error rule. The only small gap is that it does not explicitly map each of these to its position within `args`.

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?

The description opens with a specific verb and enumerates the exact resource types it operates on (Switch, Slider, Picker, SegmentedControl) and what it does to them (calls onValueChange, waits for render, reads back). An agent can immediately distinguish this from screen_fill (text entry) or screen_press without opening a 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 gives clear per-control-type guidance: Switch takes true/false, Slider a number within min/max and step, Picker a Picker.Item value, SegmentedControl one of its values, and wrong types produce an error listing options. It also explains the escape hatches ({force:true}, {scroll:true}, {index:n}) and when they are needed, though it never explicitly contrasts against sibling tools such as screen_fill.

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