java_screenshot
Captures a PNG of a Java window or specific element when the accessibility tree cannot represent charts, canvases, or layout issues; use it for visual inspection, not for finding actionable elements.
Instructions
A PNG of the window, or of one element inside it.
Use it when the accessibility tree is not enough — a chart, a canvas, a layout problem — and remember what it cannot do: a picture is not readable structure. Anything you want to act on should be found in the tree with java_snapshot or java_find, because that is where the handles and the names are. Canvas-drawn interfaces are the case where this is the only thing that works, and the only thing that is not there.
With a handle, the element is verified first, for the same reason an action is: a picture of whatever moved into the position would mislead exactly as a click on it would.
Args: session_id: From java_attach_window. handle: Optional element to photograph instead of the whole window.
Returns: The image itself, as an image content block. Nothing else: a caption would be text, and everything a caller needs to know is in the arguments it passed.
Errors:
is_error for an unknown session or handle, an element that changed, or a
window whose geometry is not reported — there is nothing to grab then, and saying
so beats an empty image.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"session_id": "<session_id>"
},
"name": "java_screenshot"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| handle | No | ||
| session_id | Yes |