capture_screenshot
Capture a screenshot from 3D Slicer for visual inspection.
This MCP tool gives the model a "what you see is what you get" view of Slicer, so it can reason about the current GUI state (panels, slice views, 3D rendering, overlays, etc.) and take follow‑up actions.
Behavior by `view_type`:
- "application": Capture the full Slicer application window, including all dock widgets, slice views and 3D views, as a compressed JPEG.
- "slice": Capture a single slice view (Red/Yellow/Green) as it currently appears on screen. The screenshot includes whatever UI elements are visible in that view (crosshair, orientation markers, labels, segment overlays, etc.).
- "3d": Capture the 3D rendering view. Optionally, a camera axis can be specified to look from a standard anatomical direction.
Parameters: view_type (str): Type of screenshot to capture. Options:
- "application" (default): Full application window.
- "slice": One named slice view.
- "3d": The 3D rendering view.
view_name (str): For slice views, which slice to capture. Options: "red", "yellow", "green". Only used when `view_type="slice"`.
camera_axis (str): For 3D views, camera view direction. Options: "L" (Left), "R" (Right), "A" (Anterior), "P" (Posterior), "I" (Inferior), "S" (Superior). Only used when `view_type="3d"`.
image_size (Optional[int]): Target pixel size for the output image.
- For slice views, this is treated as a maximum for the longer side of the captured pixmap; the image is scaled with preserved aspect ratio up to this size.
- For application and 3D views, the screenshot is captured at the current window size and may be downscaled if its longest side exceeds an internal maximum (for size control). Callers should not rely on an exact pixel size, only that larger values produce higher‑resolution images within reasonable limits.
Returns: list[mcp.types.Content]:
TextContent`: A short, human‑readable description of what was captured (e.g. which view and approximate size).ImageContent`: The screenshot image in base64‑encoded JPEG format when capture succeeds, or omitted if only an error message is returned.
Note: This tool is primarily intended for multimodal models. Callers should inspect the returned screenshot with their vision capabilities (rather than relying only on the text summary) when reasoning about Slicer's state, UI layout, overlays, or other visual details.
The internal capture mechanism (e.g. which Slicer APIs or endpoints are used) is considered an implementation detail and may evolve over time without breaking this public contract.