handle_dialog
Answers Swing dialogs by pressing buttons or close, entering text, or supplying file paths; waits until the dialog is usable and returns the updated UI snapshot.
Instructions
Answer a dialog like a user: press one of its buttons by text or by role (ok, yes, no, cancel; open/save in file choosers; these work in any UI language), "close" for the window's close box. text first types the answer of an input dialog (or picks it in its combo box); path first puts a file or directory path into a file chooser and, unless button says otherwise, presses its Open/Save button. Without ref: the open modal dialog (or the newest dialog). The result repeats the dialog's title and message. To answer a dialog that an action will open, pass dialog= to that action instead. Waits first (up to timeoutMs) until the component is visible, enabled, editable where needed, and not blocked by a modal dialog or busy overlay, so no wait_for is needed for a component that is about to become usable. Returns the new snapshot.
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": "handle_dialog"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | The dialog (or any component in it); default: the open modal dialog | |
| path | No | File or directory for a file chooser | |
| text | No | Answer for an input dialog | |
| button | No | Button text, or ok/yes/no/cancel/open/save, or close | |
| timeoutMs | No | How long to wait for the component to become usable (default 10000) |