press
Presses a button, just as a click would. If a message box is up, the button is one of its own; otherwise it is one of the loot panel a container opens: Take All or Close. gui shows both.
A box that asks for text (its input in gui, such as a name) takes text to type into it before the button; an empty field is refused unless allowEmpty is true. For a message box, the answer includes the button pressed, the box text and any text sent. Take All returns what was taken, what is left and whether the backpack was full, and closes the panel unless it was full.
Arguments
| Name | Type | Required | What |
|---|---|---|---|
button | any | yes | The button’s label (such as “Take All”) or its position, counting from 0. |
text | string | For a box with a text field: what to type into it before the button. | |
allowEmpty | boolean | Send a box’s text field empty. Default false (refused). |
Call it as press over MCP, or POST /api/tool/press with the arguments as JSON.