{"at":"2026-11-23T00:30:51.540Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T00:30:52.462Z","dir":"received","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","result":{"_meta":{"io.modelcontextprotocol/serverInfo":{"name":"pyjab_mcp","version":"0.3.1"}},"cacheScope":"private","capabilities":{"prompts":{"listChanged":true},"resources":{"listChanged":true,"subscribe":true},"tools":{"listChanged":true}},"instructions":"Drives Java desktop applications (Swing/AWT) through Java Access Bridge, via pyjab. It never modifies, restarts or injects into the target application. Start with java_diagnostics if anything looks wrong: it reports which part of the environment is missing instead of failing silently. All tools must run on the same Windows machine as the application. JavaFX is not supported: it publishes accessibility through UI Automation rather than Java Access Bridge, so JAB never sees the window (pyjab#227).","resultType":"complete","supportedVersions":["2026-07-28"],"ttlMs":0}}}
{"at":"2026-11-23T00:30:52.462Z","dir":"sent","era":"server_discover","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T00:30:52.463Z","dir":"received","era":"server_discover","message":{"id":2,"jsonrpc":"2.0","result":{"_meta":{"io.modelcontextprotocol/serverInfo":{"name":"pyjab_mcp","version":"0.3.1"}},"cacheScope":"private","resultType":"complete","tools":[{"annotations":{"openWorldHint":true,"readOnlyHint":true},"description":"Report whether this machine can drive a Java application right now.\n\nUse this first when anything fails, and after installing a JVM or enabling Java\nAccess Bridge. It reports the platform, the interpreter, the installed pyjab and\nwhich of its public APIs are present, whether Java Access Bridge is enabled, where\nthe bridge DLL is, and the state of the bridge thread.\n\nIt is read-only and never writes to the environment: it does not enable Java Access\nBridge, because a diagnostics tool that changes what it is reporting on is worse\nthan none.\n\nArgs:\n    load_bridge: When true, also start the bridge thread first and report whether it\n        came up. This is the end-to-end check; it is off by default so that a mere\n        report cannot load a DLL.\n\nReturns:\n    A multi-line report. A line that could not be measured says\n    ``UNAVAILABLE (reason)`` and is never reported as zero or as \"missing\" --\n    \"nothing is there\" and \"I could not read\" are different answers.\n\nErrors:\n    None for the environment itself: an unusable environment is what this tool\n    reports, so it does not fail because of one.\n","inputSchema":{"properties":{"load_bridge":{"default":false,"title":"Load Bridge","type":"boolean"}},"title":"java_diagnosticsArguments","type":"object"},"name":"java_diagnostics","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_diagnosticsOutput","type":"object"}},{"annotations":{"openWorldHint":true,"readOnlyHint":true},"description":"List the Java windows Java Access Bridge can see on this machine.\n\nUse this to find out whether the application is visible to JAB at all, and to get a\ntitle or hwnd for java_attach_window. If the application is not in this list,\nnothing else will work and the problem is the attachment or the environment, not a\nlocator -- run java_diagnostics next.\n\nOnly windows of Java applications are listed; this is not a general Windows window\nlist.\n\nReturns:\n    One line per window, with hwnd, pid and title. \"No Java windows are visible\" is\n    a measurement and is reported as such, not as an empty string.\n\nErrors:\n    ``is_error`` with an actionable message when pyjab cannot answer. On pyjab 1.9.0\n    the listing runs through the documented ``pyjab-inspect windows --json``,\n    because the function behind it is not public API yet; the message says so when\n    even that is unavailable.\n","inputSchema":{"properties":{},"title":"java_list_windowsArguments","type":"object"},"name":"java_list_windows","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_list_windowsOutput","type":"object"}},{"annotations":{"openWorldHint":true},"description":"Bind to one Java window and return a session id for later calls.\n\nUse this after java_list_windows, once you know which window to drive. Give either\nan exact ``hwnd`` or a ``title``; a title may be an fnmatch pattern\n(``\"*Report*\"``) exactly as pyjab matches it. Pass ``hwnd`` when several windows\nshare a title pattern.\n\nBinding is also what arms Java Access Bridge for this server: pyjab loads the DLL,\nhooks the events and registers the JAB prototypes on the thread doing the binding,\nso the first attach is slower than the later ones.\n\nThis never modifies, restarts or injects into the application, and it does not own\nthe process: the application keeps running whatever happens to this session.\n\nArgs:\n    title: Window title, matched with fnmatch. Ignored when ``hwnd`` is given.\n    hwnd: Window handle from java_list_windows. Takes precedence over ``title``.\n\nReturns:\n    A session id, and the window it is bound to. Pass the session id to\n    java_snapshot.\n\nErrors:\n    ``is_error`` when the window cannot be bound, naming what was tried. A window\n    that is not a Java window, or a title that never appears, is the usual reason;\n    java_list_windows shows what JAB can see.\n","inputSchema":{"properties":{"hwnd":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Hwnd"},"title":{"default":"","title":"Title","type":"string"}},"title":"java_attach_windowArguments","type":"object"},"name":"java_attach_window","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_attach_windowOutput","type":"object"}},{"annotations":{"openWorldHint":true,"readOnlyHint":true},"description":"The bounded tree view of an attached window, one line per element, with handles.\n\nThis is the tool to reach for first after attaching: it shows what is in the window,\nwhat each element is called, and a handle (``[e:1a2b]``) for every element a later\ncall can name. Pass a handle to a tool that acts on elements; pass a session id\nhere.\n\nThe view is deliberately bounded, and it says so when it was cut short. A Java\nwindow can hold thousands of nodes, and returning one puts hundreds of thousands of\ntokens into the conversation, so read in rings: snapshot at depth 2, then snapshot\nagain if you need to see inside something.\n\nHandles are positions, not references: nothing is held between calls. Each handle\nrecords the element's role, name, position among siblings and bounds, and a later\ncall re-finds the element and checks those before doing anything. If the window\nmoved on -- a list reloaded, a dialog replaced a panel -- the handle fails with the\ndifference rather than acting on whatever is there now.\n\nArgs:\n    session_id: From java_attach_window.\n    depth: How many levels below the window to read. 2 is a good default; raise it\n        only when the elements you want are not visible at 2.\n    max_nodes: Hard cap on rendered elements. When it is reached the reply says so\n        and names the way to narrow the next read.\n    only_interactive: Drop pure layout scaffolding (panes, panels, viewports). Set\n        it to false when you need the structure rather than the controls, or when\n        an element you expect is missing -- filtering is the usual reason.\n    fields: Extra per-element fields to print: any of states (the default), bounds,\n        description, children, index, depth. Role and name are always printed,\n        because they are what a handle checks itself against.\n\nReturns:\n    One line per element, indented by depth, plus a truncation notice when the view\n    was cut short and a count of elements that have no handle.\n\nErrors:\n    ``is_error`` for an unknown session id (the message lists the live ones), or\n    when the window can no longer be read -- which usually means the application\n    closed it.\n","inputSchema":{"properties":{"depth":{"default":2,"title":"Depth","type":"integer"},"fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"title":"Fields"},"max_nodes":{"default":120,"title":"Max Nodes","type":"integer"},"only_interactive":{"default":true,"title":"Only Interactive","type":"boolean"},"session_id":{"title":"Session Id","type":"string"}},"required":["session_id"],"title":"java_snapshotArguments","type":"object"},"name":"java_snapshot","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_snapshotOutput","type":"object"}},{"annotations":{"openWorldHint":true,"readOnlyHint":true},"description":"Search an attached window and get a handle for each match.\n\nUse this when a snapshot is too large to read, or when you know what the control is\ncalled and do not want to walk the tree to find it. A snapshot shows you the shape of\nthe window; this asks a question about it.\n\nGive **exactly one** selector. `name` and `description` are exact matches -- for a\nsubstring use `xpath` with `contains()`, which is pyjab's locator syntax:\n`//push button[@name=contains('Save')]`. `states` takes a comma-joined list such as\n`\"enabled,showing\"`.\n\nEvery match gets a handle, and a handle is checked before it is used: the locator\nrecorded here is resolved again later and compared against the role, name, position\nand bounds seen now. If a match cannot be given a locator that finds it again, it is\nlisted **without** a handle rather than with one that might resolve to something else.\n\nArgs:\n    session_id: From java_attach_window.\n    name: Exact accessible name.\n    role: Role, as pyjab spells it: \"push button\", \"text\", \"check box\", \"table\".\n    description: Exact accessible description, for controls with no name.\n    states: Comma-joined states, e.g. \"enabled,showing\".\n    xpath: A pyjab locator, for substrings, unions and paths.\n    max_results: Stop after this many matches.\n\nReturns:\n    One line per match with its handle and locator, or a measurement that nothing\n    matched -- with the selector that found nothing in it, so the next attempt can be\n    narrower rather than identical.\n\nErrors:\n    ``is_error`` for an unknown session id, for no selector or more than one, or when\n    the window can no longer be read.\n","inputSchema":{"properties":{"description":{"default":"","title":"Description","type":"string"},"max_results":{"default":20,"title":"Max Results","type":"integer"},"name":{"default":"","title":"Name","type":"string"},"role":{"default":"","title":"Role","type":"string"},"session_id":{"title":"Session Id","type":"string"},"states":{"default":"","title":"States","type":"string"},"xpath":{"default":"","title":"Xpath","type":"string"}},"required":["session_id"],"title":"java_findArguments","type":"object"},"name":"java_find","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_findOutput","type":"object"}},{"annotations":{"openWorldHint":true,"readOnlyHint":true},"description":"Everything known about one element, and whether it is still the same element.\n\nUse this after java_snapshot or java_find to look at one control in detail, or to\nconfirm that a handle still points at what it did. The handle is resolved again and\ncompared against what was recorded when it was handed out; if anything differs --\nrole, name, position among siblings, bounds -- this reports the difference instead of\npresenting the element as if nothing had changed.\n\nArgs:\n    session_id: From java_attach_window.\n    handle: An ``e:...`` handle from a snapshot or a find.\n\nReturns:\n    The element's role, name, description, states, bounds, index and depth, its\n    locator, and the verification result.\n\nErrors:\n    ``is_error`` for an unknown handle (the message says to take a fresh snapshot),\n    for a handle belonging to another session, or when the element has changed.\n","inputSchema":{"properties":{"handle":{"title":"Handle","type":"string"},"session_id":{"title":"Session Id","type":"string"}},"required":["session_id","handle"],"title":"java_get_elementArguments","type":"object"},"name":"java_get_element","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_get_elementOutput","type":"object"}},{"annotations":{"openWorldHint":true,"readOnlyHint":true},"description":"Read the text of an element: a label, a text field, a table cell, a document.\n\nUse this on a handle from a snapshot or a find. The same verification applies, so a\ntext field that has been replaced since the snapshot reports the change instead of\nreturning whatever is there now.\n\nLong values are cut, and the cut is reported: the reply says how much of the whole\ntext it carries and what the whole text's length is, so a partial read is never\npresented as the value.\n\nArgs:\n    session_id: From java_attach_window.\n    handle: An ``e:...`` handle from a snapshot or a find.\n    start: Character to start at, 0-based.\n    length: How many characters to return.\n\nReturns:\n    The slice of the element's text, with its length and whether it was cut.\n\nErrors:\n    ``is_error`` for an unknown handle, a handle from another session, an element\n    that has changed, or an element with no text at all -- which is reported as such,\n    because \"this control has no text\" and \"this control is empty\" are different\n    answers.\n","inputSchema":{"properties":{"handle":{"title":"Handle","type":"string"},"length":{"default":2000,"title":"Length","type":"integer"},"session_id":{"title":"Session Id","type":"string"},"start":{"default":0,"title":"Start","type":"integer"}},"required":["session_id","handle"],"title":"java_get_textArguments","type":"object"},"name":"java_get_text","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_get_textOutput","type":"object"}},{"annotations":{"openWorldHint":true,"readOnlyHint":true},"description":"Read a Java table, a page of rows at a time.\n\nUse this on a handle for a `table` element -- from java_snapshot or java_find. This is\nthe tool a platform-level automation cannot replace: it reads the table's own\naccessibility interface, so cell text, row and column counts come from the JVM rather\nthan from pixels or from a bridge that does not carry them.\n\nIt never returns the whole table. A large table is 200 rows in pyjab's own test\napplication and thousands in a real one, so the read is paged by `row_start` and\nbounded by `row_count` and `max_cells`, and the reply says what it left out and how to\nask for it.\n\nCells are not just text. A cell with no text interface is shown as `-`, and a cell\nthat could not be read is shown as `?` with a count: \"this cell has no text\" and \"I\ncould not read this cell\" are different answers, and reporting the second as the\nfirst would invent an empty table.\n\nArgs:\n    session_id: From java_attach_window.\n    handle: A handle for the table element.\n    row_start: First row to read, 0-based.\n    row_count: How many rows to read.\n    max_cells: Hard cap on cells read in one call, whatever the rows ask for.\n\nReturns:\n    The table's row and column counts, then one line per row, then what was left out.\n\nErrors:\n    ``is_error`` for an unknown handle, an element that changed since the snapshot, or\n    an element that is not a table -- which is reported with what it is instead, so a\n    wrong handle and a stale handle do not look the same.\n","inputSchema":{"properties":{"handle":{"title":"Handle","type":"string"},"max_cells":{"default":400,"title":"Max Cells","type":"integer"},"row_count":{"default":20,"title":"Row Count","type":"integer"},"row_start":{"default":0,"title":"Row Start","type":"integer"},"session_id":{"title":"Session Id","type":"string"}},"required":["session_id","handle"],"title":"java_get_tableArguments","type":"object"},"name":"java_get_table","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_get_tableOutput","type":"object"}},{"annotations":{"destructiveHint":true,"openWorldHint":true},"description":"Click an element: a button, a menu item, a check box, a link, a tree node.\n\nBy default this uses the element's **accessibility action**, which is what the\napplication itself exposes: no mouse moves, no window comes to the front, and it works\nwhere there is no interactive desktop. Use `simulate=True` when the accessibility\naction is ignored — it drives real mouse input, which requires the window to come to\nthe front and cannot work from a service session, and it needs real geometry (cells in\nsome tables report `bounds = -1`, and there is no point to click).\n\nThe element is checked before it is clicked: role, name, position among siblings and\nbounds are compared against what the snapshot recorded, and if anything differs\n**nothing is clicked** — the difference is reported instead. That is deliberate: a\nclick that lands on whatever moved into the position is worse than a message.\n\nArgs:\n    session_id: From java_attach_window.\n    handle: The element to click.\n    click: \"left\", \"double\" or \"right\".\n    simulate: Drive real mouse input instead of the accessibility action.\n\nReturns:\n    What was clicked and how, so the next call knows what state the window is in.\n\nErrors:\n    ``is_error`` for an unknown handle, for an element that changed since the\n    snapshot, and for a ``click`` value that is not one of the three.\n","inputSchema":{"properties":{"click":{"default":"left","title":"Click","type":"string"},"handle":{"title":"Handle","type":"string"},"session_id":{"title":"Session Id","type":"string"},"simulate":{"default":false,"title":"Simulate","type":"boolean"}},"required":["session_id","handle"],"title":"java_clickArguments","type":"object"},"name":"java_click","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_clickOutput","type":"object"}},{"annotations":{"destructiveHint":true,"openWorldHint":true},"description":"Type into a text field, text area or editable combo box.\n\nThis sets the text rather than appending to it, and it waits for the field to report\nthe new value before returning, so a following read sees what was typed. By default it\ngoes through the accessibility action; `simulate=True` types real keystrokes instead,\nwhich is the fallback when the action is refused.\n\nUse java_fill_form instead when several fields need values: it is one round trip and\nit reports each field separately.\n\nThe element is verified before anything is typed, exactly as java_click describes.\n\nArgs:\n    session_id: From java_attach_window.\n    handle: The field to type into.\n    value: The text to set.\n    simulate: Type real keystrokes instead of using the accessibility action.\n\nReturns:\n    What was set, and a reminder to re-read the field to confirm.\n\nErrors:\n    ``is_error`` for an unknown handle, an element that changed, or a field that\n    refused the text — the message says to try ``simulate=True`` when that is the\n    likely answer.\n","inputSchema":{"properties":{"handle":{"title":"Handle","type":"string"},"session_id":{"title":"Session Id","type":"string"},"simulate":{"default":false,"title":"Simulate","type":"boolean"},"value":{"title":"Value","type":"string"}},"required":["session_id","handle","value"],"title":"java_set_textArguments","type":"object"},"name":"java_set_text","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_set_textOutput","type":"object"}},{"annotations":{"destructiveHint":true,"openWorldHint":true},"description":"Select an option in a combo box, list or tab set — or a row or cell in a table.\n\nTwo shapes, and which one you want is told by the arguments:\n\n* `option=\"Tennis\"` selects by the text the application shows, for a combo box, a list\n  or a tab.\n* `row=2` selects a whole table row, and `row=2, column=1` selects one cell. Table\n  selection goes through the table's own accessible selection, which is the path the\n  application responds to — pyjab's docs are explicit that the cells `get_cell()`\n  returns often report `bounds = -1` and cannot be clicked.\n\nThe element is verified before anything is selected, exactly as java_click describes.\n\nArgs:\n    session_id: From java_attach_window.\n    handle: The combo box, list, tab set or table.\n    option: Text to select. Ignored when a row is given.\n    row: Row index to select, 0-based.\n    column: Column index, for one cell rather than the whole row.\n    simulate: Use simulated input where the action supports it.\n\nReturns:\n    What was selected, and how.\n\nErrors:\n    ``is_error`` for an unknown handle, an element that changed, an option the control\n    does not have, or neither an option nor a row given.\n","inputSchema":{"properties":{"column":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Column"},"handle":{"title":"Handle","type":"string"},"option":{"default":"","title":"Option","type":"string"},"row":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Row"},"session_id":{"title":"Session Id","type":"string"},"simulate":{"default":false,"title":"Simulate","type":"boolean"}},"required":["session_id","handle"],"title":"java_selectArguments","type":"object"},"name":"java_select","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_selectOutput","type":"object"}},{"annotations":{"destructiveHint":true,"openWorldHint":true},"description":"Fill several fields in one call: a list of ``{\"handle\": ..., \"value\": ...}``.\n\nA form is usually several fields, and setting them one at a time costs a round trip\neach. This is the same verification and the same typing, applied in order, with one\nreply that says what happened to every field.\n\nIt **does not stop at the first failure**. A form that is half filled with no report is\nworse than one that is half filled with one: every field is attempted, and each line\nsays whether it worked and why not.\n\nArgs:\n    session_id: From java_attach_window.\n    fields: ``[{\"handle\": \"e:1a2b\", \"value\": \"admin\"}, ...]``, applied in order.\n    simulate: Type real keystrokes instead of using the accessibility action.\n\nReturns:\n    One line per field — set, or the reason it was not — and a count.\n\nErrors:\n    ``is_error`` only for an unknown session, an empty list, or a malformed entry.\n    A field that fails is reported in the reply, because that is a result rather than\n    a failed call.\n","inputSchema":{"properties":{"fields":{"items":{"additionalProperties":true,"type":"object"},"title":"Fields","type":"array"},"session_id":{"title":"Session Id","type":"string"},"simulate":{"default":false,"title":"Simulate","type":"boolean"}},"required":["session_id","fields"],"title":"java_fill_formArguments","type":"object"},"name":"java_fill_form","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_fill_formOutput","type":"object"}},{"annotations":{"destructiveHint":true,"openWorldHint":true},"description":"Send a keyboard shortcut — ``alt+y``, ``ctrl+shift+s`` — to the window.\n\nUse it for an action the application only exposes as a chord: a menu accelerator, a\ntoolbar shortcut, a keystroke a canvas-drawn control listens for.\n\n**Nothing is focused and nothing is clicked.** The chord goes to whichever window\ncurrently has the keyboard focus. That is deliberate on pyjab's side: clicking a\ncontrol to focus its window would activate that control, and a shortcut usually exists\nto avoid exactly that.\n\nSo if a call seems to do nothing, the window probably does not have focus — and\n**attaching does not focus it** (measured in pyjab#180). Call\n`java_focus_window(session_id=...)` first and read what it reports: it says whether the\nwindow *came forward*, which is the fact this tool needs. (Before that tool existed\nthis reply said to click something harmless first; that workaround is gone from the\nshipped text, because it activated whatever it landed on and went through a locator\nthat could have gone stale — which is the thing a shortcut exists to avoid.)\n\nChords are written with `+` between key names and are case-insensitive:\n`ctrl`, `alt`, `shift`, `tab`, `enter`, `escape`, `spacebar`, the arrow keys, and\nsingle letters or digits. A name that is not a key is an error rather than a silent\nno-op — a wrong chord acts on somebody else's application and cannot be taken back.\n\nThis needs pyjab 1.11.0, which released `JABDriver.send_keys`\n(gaozhao1989/pyjab#168 went in after 1.10.0). The call is probed rather than assumed,\nlike every pyjab capability here: an install below the pin is told which release has\nthe method instead of raising an `AttributeError`.\n\nArgs:\n    session_id: From java_attach_window.\n    keys: The chord, such as \"alt+y\".\n\nReturns:\n    What was sent, and the reminder that a shortcut's effect has to be looked for —\n    this tool cannot see what the application did with it.\n\nErrors:\n    ``is_error`` for an unknown session, a chord whose key names pyjab does not\n    recognise (with the name it did not recognise), or a pyjab below the pin — which\n    names the release that has the API and what to do instead.\n","inputSchema":{"properties":{"keys":{"title":"Keys","type":"string"},"session_id":{"title":"Session Id","type":"string"}},"required":["session_id","keys"],"title":"java_send_keysArguments","type":"object"},"name":"java_send_keys","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_send_keysOutput","type":"object"}},{"annotations":{"destructiveHint":true,"openWorldHint":true},"description":"Bring an attached window to the front, and report whether it actually came forward.\n\nUse it before `java_send_keys`, whose chord goes to whichever window has the keyboard\nfocus: **attaching a window does not give it focus** (measured in pyjab#180), so a\nshortcut can otherwise land somewhere else entirely.\n\n**The reply is the point, not the action.** \"I asked for focus\" and \"the window is now\nin front\" are two different facts, and this tool answers with the second one. It does so\nby reading back the state pyjab left behind, because Windows' `SetForegroundWindow` has\nno useful return of its own. So there are three answers, not two:\n\n* the window **is** the foreground window now;\n* it **is not** — a normal answer rather than a failure, because Windows refuses\n  foreground activation from a non-interactive session (a service, a scheduled task) and\n  no amount of retrying changes that. An error would be wrong here: nothing failed, and\n  the caller has a fact it can act on;\n* pyjab answered something that is neither `True` nor `False`, so this server **cannot\n  say** — reported as such rather than filed under \"did not come forward\", because \"I\n  could not tell\" is not a measurement.\n\nIt is not free: **when the window is not already in front**, pyjab sends a space\nkeystroke first, which is what Windows' foreground-activation rules require of a process\nthat wants the foreground — and that keystroke goes to whatever currently has the focus.\nA caller that cannot tolerate a stray keystroke elsewhere should not call this.\n\nThis needs pyjab 1.11.0, which released `JABDriver.focus()`. The call is probed rather\nthan assumed, like every pyjab capability here: an install below the pin is told which\nrelease has it instead of raising an `AttributeError`.\n\nArgs:\n    session_id: From java_attach_window.\n\nReturns:\n    Whether the window is now the foreground window, said plainly, with the next step.\n\nErrors:\n    ``is_error`` only for an unknown session, or a pyjab below the pin — which names the\n    release that has the API. \"It did not come forward\" is a result, not an error.\n","inputSchema":{"properties":{"session_id":{"title":"Session Id","type":"string"}},"required":["session_id"],"title":"java_focus_windowArguments","type":"object"},"name":"java_focus_window","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_focus_windowOutput","type":"object"}},{"annotations":{"openWorldHint":true,"readOnlyHint":true},"description":"Wait for something to happen, instead of asking too early and being told no.\n\nThree conditions, chosen by what you pass:\n\n* `window_title=\"A Dialog\"` — wait until a Java window with that title (fnmatch, so\n  `\"*Progress*\"` works) exists. Use it after an action that opens one.\n* `handle=..., text_equals=\"Saved\"` — wait until that element's text *is* this.\n* `handle=...` alone — wait until its text *changes* from what it reads when the wait\n  starts, and report both values.\n\n**A timeout is a result, not an error.** The reply says the condition was not met and\nwhat was seen instead, because \"not yet\" is information an agent can act on — it can\nwait longer, look somewhere else, or take a snapshot — while an error reads as a\nfailed call. pyjab's own waits raise; this one reports, and the difference is\ndeliberate for a tool a model is driving.\n\nThe waiting happens here rather than inside pyjab, and that is also deliberate: the\nbridge has exactly one owning thread, so a wait that ran *on* it would block every\nother call for its whole duration. This polls between calls instead, which also means\na client can cancel it.\n\nArgs:\n    session_id: From java_attach_window.\n    window_title: Title (fnmatch) of a window to wait for.\n    handle: An element whose text to watch.\n    text_equals: The text to wait for, with a handle.\n    timeout: Give up after this many seconds.\n    poll_interval: Seconds between checks. A window wait re-lists the Java windows\n        on every poll; on an install below the pin that listing is the\n        ``pyjab-inspect`` subprocess rather than a bridge call, so raise this.\n\nReturns:\n    Whether the condition was met, how long it took, and what was seen.\n\nErrors:\n    ``is_error`` only for an unknown session or handle, or for no condition at all.\n    A timeout is reported in the reply, not as an error.\n","inputSchema":{"properties":{"handle":{"default":"","title":"Handle","type":"string"},"poll_interval":{"default":0.5,"title":"Poll Interval","type":"number"},"session_id":{"title":"Session Id","type":"string"},"text_equals":{"default":"","title":"Text Equals","type":"string"},"timeout":{"default":10.0,"title":"Timeout","type":"number"},"window_title":{"default":"","title":"Window Title","type":"string"}},"required":["session_id"],"title":"java_wait_forArguments","type":"object"},"name":"java_wait_for","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_wait_forOutput","type":"object"}},{"annotations":{"openWorldHint":true,"readOnlyHint":true},"description":"A PNG of the window, or of one element inside it.\n\nUse it when the accessibility tree is not enough — a chart, a canvas, a layout problem\n— and remember what it cannot do: **a picture is not readable structure.** Anything\nyou want to act on should be found in the tree with java_snapshot or java_find, because\nthat is where the handles and the names are. Canvas-drawn interfaces are the case where\nthis is the only thing that works, and the only thing that is not there.\n\nWith a handle, the element is verified first, for the same reason an action is: a\npicture of whatever moved into the position would mislead exactly as a click on it\nwould.\n\nArgs:\n    session_id: From java_attach_window.\n    handle: Optional element to photograph instead of the whole window.\n\nReturns:\n    The image itself, as an image content block. Nothing else: a caption would be\n    text, and everything a caller needs to know is in the arguments it passed.\n\nErrors:\n    ``is_error`` for an unknown session or handle, an element that changed, or a\n    window whose geometry is not reported — there is nothing to grab then, and saying\n    so beats an empty image.\n","inputSchema":{"properties":{"handle":{"default":"","title":"Handle","type":"string"},"session_id":{"title":"Session Id","type":"string"}},"required":["session_id"],"title":"java_screenshotArguments","type":"object"},"name":"java_screenshot"}],"ttlMs":0}}}
{"at":"2026-11-23T00:30:52.614Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T00:30:53.520Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"prompts":{"listChanged":false},"resources":{"listChanged":false,"subscribe":false},"tools":{"listChanged":false}},"instructions":"Drives Java desktop applications (Swing/AWT) through Java Access Bridge, via pyjab. It never modifies, restarts or injects into the target application. Start with java_diagnostics if anything looks wrong: it reports which part of the environment is missing instead of failing silently. All tools must run on the same Windows machine as the application. JavaFX is not supported: it publishes accessibility through UI Automation rather than Java Access Bridge, so JAB never sees the window (pyjab#227).","protocolVersion":"2025-11-25","serverInfo":{"name":"pyjab_mcp","version":"0.3.1"}}}}
{"at":"2026-11-23T00:30:53.520Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T00:30:53.520Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T00:30:53.522Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"annotations":{"openWorldHint":true,"readOnlyHint":true},"description":"Report whether this machine can drive a Java application right now.\n\nUse this first when anything fails, and after installing a JVM or enabling Java\nAccess Bridge. It reports the platform, the interpreter, the installed pyjab and\nwhich of its public APIs are present, whether Java Access Bridge is enabled, where\nthe bridge DLL is, and the state of the bridge thread.\n\nIt is read-only and never writes to the environment: it does not enable Java Access\nBridge, because a diagnostics tool that changes what it is reporting on is worse\nthan none.\n\nArgs:\n    load_bridge: When true, also start the bridge thread first and report whether it\n        came up. This is the end-to-end check; it is off by default so that a mere\n        report cannot load a DLL.\n\nReturns:\n    A multi-line report. A line that could not be measured says\n    ``UNAVAILABLE (reason)`` and is never reported as zero or as \"missing\" --\n    \"nothing is there\" and \"I could not read\" are different answers.\n\nErrors:\n    None for the environment itself: an unusable environment is what this tool\n    reports, so it does not fail because of one.\n","inputSchema":{"properties":{"load_bridge":{"default":false,"title":"Load Bridge","type":"boolean"}},"title":"java_diagnosticsArguments","type":"object"},"name":"java_diagnostics","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_diagnosticsOutput","type":"object"}},{"annotations":{"openWorldHint":true,"readOnlyHint":true},"description":"List the Java windows Java Access Bridge can see on this machine.\n\nUse this to find out whether the application is visible to JAB at all, and to get a\ntitle or hwnd for java_attach_window. If the application is not in this list,\nnothing else will work and the problem is the attachment or the environment, not a\nlocator -- run java_diagnostics next.\n\nOnly windows of Java applications are listed; this is not a general Windows window\nlist.\n\nReturns:\n    One line per window, with hwnd, pid and title. \"No Java windows are visible\" is\n    a measurement and is reported as such, not as an empty string.\n\nErrors:\n    ``is_error`` with an actionable message when pyjab cannot answer. On pyjab 1.9.0\n    the listing runs through the documented ``pyjab-inspect windows --json``,\n    because the function behind it is not public API yet; the message says so when\n    even that is unavailable.\n","inputSchema":{"properties":{},"title":"java_list_windowsArguments","type":"object"},"name":"java_list_windows","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_list_windowsOutput","type":"object"}},{"annotations":{"openWorldHint":true},"description":"Bind to one Java window and return a session id for later calls.\n\nUse this after java_list_windows, once you know which window to drive. Give either\nan exact ``hwnd`` or a ``title``; a title may be an fnmatch pattern\n(``\"*Report*\"``) exactly as pyjab matches it. Pass ``hwnd`` when several windows\nshare a title pattern.\n\nBinding is also what arms Java Access Bridge for this server: pyjab loads the DLL,\nhooks the events and registers the JAB prototypes on the thread doing the binding,\nso the first attach is slower than the later ones.\n\nThis never modifies, restarts or injects into the application, and it does not own\nthe process: the application keeps running whatever happens to this session.\n\nArgs:\n    title: Window title, matched with fnmatch. Ignored when ``hwnd`` is given.\n    hwnd: Window handle from java_list_windows. Takes precedence over ``title``.\n\nReturns:\n    A session id, and the window it is bound to. Pass the session id to\n    java_snapshot.\n\nErrors:\n    ``is_error`` when the window cannot be bound, naming what was tried. A window\n    that is not a Java window, or a title that never appears, is the usual reason;\n    java_list_windows shows what JAB can see.\n","inputSchema":{"properties":{"hwnd":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Hwnd"},"title":{"default":"","title":"Title","type":"string"}},"title":"java_attach_windowArguments","type":"object"},"name":"java_attach_window","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_attach_windowOutput","type":"object"}},{"annotations":{"openWorldHint":true,"readOnlyHint":true},"description":"The bounded tree view of an attached window, one line per element, with handles.\n\nThis is the tool to reach for first after attaching: it shows what is in the window,\nwhat each element is called, and a handle (``[e:1a2b]``) for every element a later\ncall can name. Pass a handle to a tool that acts on elements; pass a session id\nhere.\n\nThe view is deliberately bounded, and it says so when it was cut short. A Java\nwindow can hold thousands of nodes, and returning one puts hundreds of thousands of\ntokens into the conversation, so read in rings: snapshot at depth 2, then snapshot\nagain if you need to see inside something.\n\nHandles are positions, not references: nothing is held between calls. Each handle\nrecords the element's role, name, position among siblings and bounds, and a later\ncall re-finds the element and checks those before doing anything. If the window\nmoved on -- a list reloaded, a dialog replaced a panel -- the handle fails with the\ndifference rather than acting on whatever is there now.\n\nArgs:\n    session_id: From java_attach_window.\n    depth: How many levels below the window to read. 2 is a good default; raise it\n        only when the elements you want are not visible at 2.\n    max_nodes: Hard cap on rendered elements. When it is reached the reply says so\n        and names the way to narrow the next read.\n    only_interactive: Drop pure layout scaffolding (panes, panels, viewports). Set\n        it to false when you need the structure rather than the controls, or when\n        an element you expect is missing -- filtering is the usual reason.\n    fields: Extra per-element fields to print: any of states (the default), bounds,\n        description, children, index, depth. Role and name are always printed,\n        because they are what a handle checks itself against.\n\nReturns:\n    One line per element, indented by depth, plus a truncation notice when the view\n    was cut short and a count of elements that have no handle.\n\nErrors:\n    ``is_error`` for an unknown session id (the message lists the live ones), or\n    when the window can no longer be read -- which usually means the application\n    closed it.\n","inputSchema":{"properties":{"depth":{"default":2,"title":"Depth","type":"integer"},"fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"title":"Fields"},"max_nodes":{"default":120,"title":"Max Nodes","type":"integer"},"only_interactive":{"default":true,"title":"Only Interactive","type":"boolean"},"session_id":{"title":"Session Id","type":"string"}},"required":["session_id"],"title":"java_snapshotArguments","type":"object"},"name":"java_snapshot","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_snapshotOutput","type":"object"}},{"annotations":{"openWorldHint":true,"readOnlyHint":true},"description":"Search an attached window and get a handle for each match.\n\nUse this when a snapshot is too large to read, or when you know what the control is\ncalled and do not want to walk the tree to find it. A snapshot shows you the shape of\nthe window; this asks a question about it.\n\nGive **exactly one** selector. `name` and `description` are exact matches -- for a\nsubstring use `xpath` with `contains()`, which is pyjab's locator syntax:\n`//push button[@name=contains('Save')]`. `states` takes a comma-joined list such as\n`\"enabled,showing\"`.\n\nEvery match gets a handle, and a handle is checked before it is used: the locator\nrecorded here is resolved again later and compared against the role, name, position\nand bounds seen now. If a match cannot be given a locator that finds it again, it is\nlisted **without** a handle rather than with one that might resolve to something else.\n\nArgs:\n    session_id: From java_attach_window.\n    name: Exact accessible name.\n    role: Role, as pyjab spells it: \"push button\", \"text\", \"check box\", \"table\".\n    description: Exact accessible description, for controls with no name.\n    states: Comma-joined states, e.g. \"enabled,showing\".\n    xpath: A pyjab locator, for substrings, unions and paths.\n    max_results: Stop after this many matches.\n\nReturns:\n    One line per match with its handle and locator, or a measurement that nothing\n    matched -- with the selector that found nothing in it, so the next attempt can be\n    narrower rather than identical.\n\nErrors:\n    ``is_error`` for an unknown session id, for no selector or more than one, or when\n    the window can no longer be read.\n","inputSchema":{"properties":{"description":{"default":"","title":"Description","type":"string"},"max_results":{"default":20,"title":"Max Results","type":"integer"},"name":{"default":"","title":"Name","type":"string"},"role":{"default":"","title":"Role","type":"string"},"session_id":{"title":"Session Id","type":"string"},"states":{"default":"","title":"States","type":"string"},"xpath":{"default":"","title":"Xpath","type":"string"}},"required":["session_id"],"title":"java_findArguments","type":"object"},"name":"java_find","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_findOutput","type":"object"}},{"annotations":{"openWorldHint":true,"readOnlyHint":true},"description":"Everything known about one element, and whether it is still the same element.\n\nUse this after java_snapshot or java_find to look at one control in detail, or to\nconfirm that a handle still points at what it did. The handle is resolved again and\ncompared against what was recorded when it was handed out; if anything differs --\nrole, name, position among siblings, bounds -- this reports the difference instead of\npresenting the element as if nothing had changed.\n\nArgs:\n    session_id: From java_attach_window.\n    handle: An ``e:...`` handle from a snapshot or a find.\n\nReturns:\n    The element's role, name, description, states, bounds, index and depth, its\n    locator, and the verification result.\n\nErrors:\n    ``is_error`` for an unknown handle (the message says to take a fresh snapshot),\n    for a handle belonging to another session, or when the element has changed.\n","inputSchema":{"properties":{"handle":{"title":"Handle","type":"string"},"session_id":{"title":"Session Id","type":"string"}},"required":["session_id","handle"],"title":"java_get_elementArguments","type":"object"},"name":"java_get_element","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_get_elementOutput","type":"object"}},{"annotations":{"openWorldHint":true,"readOnlyHint":true},"description":"Read the text of an element: a label, a text field, a table cell, a document.\n\nUse this on a handle from a snapshot or a find. The same verification applies, so a\ntext field that has been replaced since the snapshot reports the change instead of\nreturning whatever is there now.\n\nLong values are cut, and the cut is reported: the reply says how much of the whole\ntext it carries and what the whole text's length is, so a partial read is never\npresented as the value.\n\nArgs:\n    session_id: From java_attach_window.\n    handle: An ``e:...`` handle from a snapshot or a find.\n    start: Character to start at, 0-based.\n    length: How many characters to return.\n\nReturns:\n    The slice of the element's text, with its length and whether it was cut.\n\nErrors:\n    ``is_error`` for an unknown handle, a handle from another session, an element\n    that has changed, or an element with no text at all -- which is reported as such,\n    because \"this control has no text\" and \"this control is empty\" are different\n    answers.\n","inputSchema":{"properties":{"handle":{"title":"Handle","type":"string"},"length":{"default":2000,"title":"Length","type":"integer"},"session_id":{"title":"Session Id","type":"string"},"start":{"default":0,"title":"Start","type":"integer"}},"required":["session_id","handle"],"title":"java_get_textArguments","type":"object"},"name":"java_get_text","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_get_textOutput","type":"object"}},{"annotations":{"openWorldHint":true,"readOnlyHint":true},"description":"Read a Java table, a page of rows at a time.\n\nUse this on a handle for a `table` element -- from java_snapshot or java_find. This is\nthe tool a platform-level automation cannot replace: it reads the table's own\naccessibility interface, so cell text, row and column counts come from the JVM rather\nthan from pixels or from a bridge that does not carry them.\n\nIt never returns the whole table. A large table is 200 rows in pyjab's own test\napplication and thousands in a real one, so the read is paged by `row_start` and\nbounded by `row_count` and `max_cells`, and the reply says what it left out and how to\nask for it.\n\nCells are not just text. A cell with no text interface is shown as `-`, and a cell\nthat could not be read is shown as `?` with a count: \"this cell has no text\" and \"I\ncould not read this cell\" are different answers, and reporting the second as the\nfirst would invent an empty table.\n\nArgs:\n    session_id: From java_attach_window.\n    handle: A handle for the table element.\n    row_start: First row to read, 0-based.\n    row_count: How many rows to read.\n    max_cells: Hard cap on cells read in one call, whatever the rows ask for.\n\nReturns:\n    The table's row and column counts, then one line per row, then what was left out.\n\nErrors:\n    ``is_error`` for an unknown handle, an element that changed since the snapshot, or\n    an element that is not a table -- which is reported with what it is instead, so a\n    wrong handle and a stale handle do not look the same.\n","inputSchema":{"properties":{"handle":{"title":"Handle","type":"string"},"max_cells":{"default":400,"title":"Max Cells","type":"integer"},"row_count":{"default":20,"title":"Row Count","type":"integer"},"row_start":{"default":0,"title":"Row Start","type":"integer"},"session_id":{"title":"Session Id","type":"string"}},"required":["session_id","handle"],"title":"java_get_tableArguments","type":"object"},"name":"java_get_table","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_get_tableOutput","type":"object"}},{"annotations":{"destructiveHint":true,"openWorldHint":true},"description":"Click an element: a button, a menu item, a check box, a link, a tree node.\n\nBy default this uses the element's **accessibility action**, which is what the\napplication itself exposes: no mouse moves, no window comes to the front, and it works\nwhere there is no interactive desktop. Use `simulate=True` when the accessibility\naction is ignored — it drives real mouse input, which requires the window to come to\nthe front and cannot work from a service session, and it needs real geometry (cells in\nsome tables report `bounds = -1`, and there is no point to click).\n\nThe element is checked before it is clicked: role, name, position among siblings and\nbounds are compared against what the snapshot recorded, and if anything differs\n**nothing is clicked** — the difference is reported instead. That is deliberate: a\nclick that lands on whatever moved into the position is worse than a message.\n\nArgs:\n    session_id: From java_attach_window.\n    handle: The element to click.\n    click: \"left\", \"double\" or \"right\".\n    simulate: Drive real mouse input instead of the accessibility action.\n\nReturns:\n    What was clicked and how, so the next call knows what state the window is in.\n\nErrors:\n    ``is_error`` for an unknown handle, for an element that changed since the\n    snapshot, and for a ``click`` value that is not one of the three.\n","inputSchema":{"properties":{"click":{"default":"left","title":"Click","type":"string"},"handle":{"title":"Handle","type":"string"},"session_id":{"title":"Session Id","type":"string"},"simulate":{"default":false,"title":"Simulate","type":"boolean"}},"required":["session_id","handle"],"title":"java_clickArguments","type":"object"},"name":"java_click","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_clickOutput","type":"object"}},{"annotations":{"destructiveHint":true,"openWorldHint":true},"description":"Type into a text field, text area or editable combo box.\n\nThis sets the text rather than appending to it, and it waits for the field to report\nthe new value before returning, so a following read sees what was typed. By default it\ngoes through the accessibility action; `simulate=True` types real keystrokes instead,\nwhich is the fallback when the action is refused.\n\nUse java_fill_form instead when several fields need values: it is one round trip and\nit reports each field separately.\n\nThe element is verified before anything is typed, exactly as java_click describes.\n\nArgs:\n    session_id: From java_attach_window.\n    handle: The field to type into.\n    value: The text to set.\n    simulate: Type real keystrokes instead of using the accessibility action.\n\nReturns:\n    What was set, and a reminder to re-read the field to confirm.\n\nErrors:\n    ``is_error`` for an unknown handle, an element that changed, or a field that\n    refused the text — the message says to try ``simulate=True`` when that is the\n    likely answer.\n","inputSchema":{"properties":{"handle":{"title":"Handle","type":"string"},"session_id":{"title":"Session Id","type":"string"},"simulate":{"default":false,"title":"Simulate","type":"boolean"},"value":{"title":"Value","type":"string"}},"required":["session_id","handle","value"],"title":"java_set_textArguments","type":"object"},"name":"java_set_text","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_set_textOutput","type":"object"}},{"annotations":{"destructiveHint":true,"openWorldHint":true},"description":"Select an option in a combo box, list or tab set — or a row or cell in a table.\n\nTwo shapes, and which one you want is told by the arguments:\n\n* `option=\"Tennis\"` selects by the text the application shows, for a combo box, a list\n  or a tab.\n* `row=2` selects a whole table row, and `row=2, column=1` selects one cell. Table\n  selection goes through the table's own accessible selection, which is the path the\n  application responds to — pyjab's docs are explicit that the cells `get_cell()`\n  returns often report `bounds = -1` and cannot be clicked.\n\nThe element is verified before anything is selected, exactly as java_click describes.\n\nArgs:\n    session_id: From java_attach_window.\n    handle: The combo box, list, tab set or table.\n    option: Text to select. Ignored when a row is given.\n    row: Row index to select, 0-based.\n    column: Column index, for one cell rather than the whole row.\n    simulate: Use simulated input where the action supports it.\n\nReturns:\n    What was selected, and how.\n\nErrors:\n    ``is_error`` for an unknown handle, an element that changed, an option the control\n    does not have, or neither an option nor a row given.\n","inputSchema":{"properties":{"column":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Column"},"handle":{"title":"Handle","type":"string"},"option":{"default":"","title":"Option","type":"string"},"row":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Row"},"session_id":{"title":"Session Id","type":"string"},"simulate":{"default":false,"title":"Simulate","type":"boolean"}},"required":["session_id","handle"],"title":"java_selectArguments","type":"object"},"name":"java_select","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_selectOutput","type":"object"}},{"annotations":{"destructiveHint":true,"openWorldHint":true},"description":"Fill several fields in one call: a list of ``{\"handle\": ..., \"value\": ...}``.\n\nA form is usually several fields, and setting them one at a time costs a round trip\neach. This is the same verification and the same typing, applied in order, with one\nreply that says what happened to every field.\n\nIt **does not stop at the first failure**. A form that is half filled with no report is\nworse than one that is half filled with one: every field is attempted, and each line\nsays whether it worked and why not.\n\nArgs:\n    session_id: From java_attach_window.\n    fields: ``[{\"handle\": \"e:1a2b\", \"value\": \"admin\"}, ...]``, applied in order.\n    simulate: Type real keystrokes instead of using the accessibility action.\n\nReturns:\n    One line per field — set, or the reason it was not — and a count.\n\nErrors:\n    ``is_error`` only for an unknown session, an empty list, or a malformed entry.\n    A field that fails is reported in the reply, because that is a result rather than\n    a failed call.\n","inputSchema":{"properties":{"fields":{"items":{"additionalProperties":true,"type":"object"},"title":"Fields","type":"array"},"session_id":{"title":"Session Id","type":"string"},"simulate":{"default":false,"title":"Simulate","type":"boolean"}},"required":["session_id","fields"],"title":"java_fill_formArguments","type":"object"},"name":"java_fill_form","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_fill_formOutput","type":"object"}},{"annotations":{"destructiveHint":true,"openWorldHint":true},"description":"Send a keyboard shortcut — ``alt+y``, ``ctrl+shift+s`` — to the window.\n\nUse it for an action the application only exposes as a chord: a menu accelerator, a\ntoolbar shortcut, a keystroke a canvas-drawn control listens for.\n\n**Nothing is focused and nothing is clicked.** The chord goes to whichever window\ncurrently has the keyboard focus. That is deliberate on pyjab's side: clicking a\ncontrol to focus its window would activate that control, and a shortcut usually exists\nto avoid exactly that.\n\nSo if a call seems to do nothing, the window probably does not have focus — and\n**attaching does not focus it** (measured in pyjab#180). Call\n`java_focus_window(session_id=...)` first and read what it reports: it says whether the\nwindow *came forward*, which is the fact this tool needs. (Before that tool existed\nthis reply said to click something harmless first; that workaround is gone from the\nshipped text, because it activated whatever it landed on and went through a locator\nthat could have gone stale — which is the thing a shortcut exists to avoid.)\n\nChords are written with `+` between key names and are case-insensitive:\n`ctrl`, `alt`, `shift`, `tab`, `enter`, `escape`, `spacebar`, the arrow keys, and\nsingle letters or digits. A name that is not a key is an error rather than a silent\nno-op — a wrong chord acts on somebody else's application and cannot be taken back.\n\nThis needs pyjab 1.11.0, which released `JABDriver.send_keys`\n(gaozhao1989/pyjab#168 went in after 1.10.0). The call is probed rather than assumed,\nlike every pyjab capability here: an install below the pin is told which release has\nthe method instead of raising an `AttributeError`.\n\nArgs:\n    session_id: From java_attach_window.\n    keys: The chord, such as \"alt+y\".\n\nReturns:\n    What was sent, and the reminder that a shortcut's effect has to be looked for —\n    this tool cannot see what the application did with it.\n\nErrors:\n    ``is_error`` for an unknown session, a chord whose key names pyjab does not\n    recognise (with the name it did not recognise), or a pyjab below the pin — which\n    names the release that has the API and what to do instead.\n","inputSchema":{"properties":{"keys":{"title":"Keys","type":"string"},"session_id":{"title":"Session Id","type":"string"}},"required":["session_id","keys"],"title":"java_send_keysArguments","type":"object"},"name":"java_send_keys","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_send_keysOutput","type":"object"}},{"annotations":{"destructiveHint":true,"openWorldHint":true},"description":"Bring an attached window to the front, and report whether it actually came forward.\n\nUse it before `java_send_keys`, whose chord goes to whichever window has the keyboard\nfocus: **attaching a window does not give it focus** (measured in pyjab#180), so a\nshortcut can otherwise land somewhere else entirely.\n\n**The reply is the point, not the action.** \"I asked for focus\" and \"the window is now\nin front\" are two different facts, and this tool answers with the second one. It does so\nby reading back the state pyjab left behind, because Windows' `SetForegroundWindow` has\nno useful return of its own. So there are three answers, not two:\n\n* the window **is** the foreground window now;\n* it **is not** — a normal answer rather than a failure, because Windows refuses\n  foreground activation from a non-interactive session (a service, a scheduled task) and\n  no amount of retrying changes that. An error would be wrong here: nothing failed, and\n  the caller has a fact it can act on;\n* pyjab answered something that is neither `True` nor `False`, so this server **cannot\n  say** — reported as such rather than filed under \"did not come forward\", because \"I\n  could not tell\" is not a measurement.\n\nIt is not free: **when the window is not already in front**, pyjab sends a space\nkeystroke first, which is what Windows' foreground-activation rules require of a process\nthat wants the foreground — and that keystroke goes to whatever currently has the focus.\nA caller that cannot tolerate a stray keystroke elsewhere should not call this.\n\nThis needs pyjab 1.11.0, which released `JABDriver.focus()`. The call is probed rather\nthan assumed, like every pyjab capability here: an install below the pin is told which\nrelease has it instead of raising an `AttributeError`.\n\nArgs:\n    session_id: From java_attach_window.\n\nReturns:\n    Whether the window is now the foreground window, said plainly, with the next step.\n\nErrors:\n    ``is_error`` only for an unknown session, or a pyjab below the pin — which names the\n    release that has the API. \"It did not come forward\" is a result, not an error.\n","inputSchema":{"properties":{"session_id":{"title":"Session Id","type":"string"}},"required":["session_id"],"title":"java_focus_windowArguments","type":"object"},"name":"java_focus_window","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_focus_windowOutput","type":"object"}},{"annotations":{"openWorldHint":true,"readOnlyHint":true},"description":"Wait for something to happen, instead of asking too early and being told no.\n\nThree conditions, chosen by what you pass:\n\n* `window_title=\"A Dialog\"` — wait until a Java window with that title (fnmatch, so\n  `\"*Progress*\"` works) exists. Use it after an action that opens one.\n* `handle=..., text_equals=\"Saved\"` — wait until that element's text *is* this.\n* `handle=...` alone — wait until its text *changes* from what it reads when the wait\n  starts, and report both values.\n\n**A timeout is a result, not an error.** The reply says the condition was not met and\nwhat was seen instead, because \"not yet\" is information an agent can act on — it can\nwait longer, look somewhere else, or take a snapshot — while an error reads as a\nfailed call. pyjab's own waits raise; this one reports, and the difference is\ndeliberate for a tool a model is driving.\n\nThe waiting happens here rather than inside pyjab, and that is also deliberate: the\nbridge has exactly one owning thread, so a wait that ran *on* it would block every\nother call for its whole duration. This polls between calls instead, which also means\na client can cancel it.\n\nArgs:\n    session_id: From java_attach_window.\n    window_title: Title (fnmatch) of a window to wait for.\n    handle: An element whose text to watch.\n    text_equals: The text to wait for, with a handle.\n    timeout: Give up after this many seconds.\n    poll_interval: Seconds between checks. A window wait re-lists the Java windows\n        on every poll; on an install below the pin that listing is the\n        ``pyjab-inspect`` subprocess rather than a bridge call, so raise this.\n\nReturns:\n    Whether the condition was met, how long it took, and what was seen.\n\nErrors:\n    ``is_error`` only for an unknown session or handle, or for no condition at all.\n    A timeout is reported in the reply, not as an error.\n","inputSchema":{"properties":{"handle":{"default":"","title":"Handle","type":"string"},"poll_interval":{"default":0.5,"title":"Poll Interval","type":"number"},"session_id":{"title":"Session Id","type":"string"},"text_equals":{"default":"","title":"Text Equals","type":"string"},"timeout":{"default":10.0,"title":"Timeout","type":"number"},"window_title":{"default":"","title":"Window Title","type":"string"}},"required":["session_id"],"title":"java_wait_forArguments","type":"object"},"name":"java_wait_for","outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"java_wait_forOutput","type":"object"}},{"annotations":{"openWorldHint":true,"readOnlyHint":true},"description":"A PNG of the window, or of one element inside it.\n\nUse it when the accessibility tree is not enough — a chart, a canvas, a layout problem\n— and remember what it cannot do: **a picture is not readable structure.** Anything\nyou want to act on should be found in the tree with java_snapshot or java_find, because\nthat is where the handles and the names are. Canvas-drawn interfaces are the case where\nthis is the only thing that works, and the only thing that is not there.\n\nWith a handle, the element is verified first, for the same reason an action is: a\npicture of whatever moved into the position would mislead exactly as a click on it\nwould.\n\nArgs:\n    session_id: From java_attach_window.\n    handle: Optional element to photograph instead of the whole window.\n\nReturns:\n    The image itself, as an image content block. Nothing else: a caption would be\n    text, and everything a caller needs to know is in the arguments it passed.\n\nErrors:\n    ``is_error`` for an unknown session or handle, an element that changed, or a\n    window whose geometry is not reported — there is nothing to grab then, and saying\n    so beats an empty image.\n","inputSchema":{"properties":{"handle":{"default":"","title":"Handle","type":"string"},"session_id":{"title":"Session Id","type":"string"}},"required":["session_id"],"title":"java_screenshotArguments","type":"object"},"name":"java_screenshot"}]}}}
