screen.snapshot
screen_snapshotRetrieves the visible elements of the focused React Native screen with text, buttons, inputs, test IDs, bounds, and accessibility state for UI inspection and automation.
Instructions
Buttons, inputs, text, and testID or labelled views on screen, with rects and checked/selected/expanded state (a Switch's value is checked). actions lists the accessibility actions an element handles; one with "activate" and no onPress (a swipe-to-confirm) is a button screen.press can press. Only the focused screen: unfocused tabs and stack screens, content under an open modal, display:none and accessibility-hidden subtrees are left out, and hidden counts the elements skipped. {all:true} lists everything, marking off-screen (onScreen:false) and hidden (hidden:true) ones. A WebView registered with the react-native-webview adapter shows as one webview element with its name: use webview.* inside it. Options: {format:"json"|"text"} (the runtime default is JSON with rects; the CLI and the MCP server return the text form unless you pass {format:"json"}). Text is one line per element: kind (or role: switch, checkbox, tab), #testID, text, label, value, state, then readonly, actions=…, offscreen, hidden. Lines that repeat get index=N (the {index} of the target that names them); a line with no testID, text, label or placeholder gets @x,y, the point for {at:[x,y]}. JSON has rects, onScreen:false and hidden:true. {kinds:["button","input"]} keeps only those kinds (kinds are button, input, text, view, webview; a switch or tab is a button); {within: target} keeps only elements under that target in the tree (a target as for screen.press; with several matches pass {testID, index} inside it).
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_snapshot"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | The tool's arguments, in order (each any JSON value). Leave out for none. | |
| full | No | Return a result over 32 KB whole instead of a summary of its size and shape. |