Screenshot API¶
Screenshot Server¶
doc_processing_std_tools.screenshot
¶
Screenshot tools MCP server.
Provides cross-platform screenshot capture capabilities using the mss
library.
take_screenshot(output_path=None, monitor=None, region=None)
¶
Capture a screenshot (full screen, specific monitor, or region).
When output_path is provided, saves the PNG to that path and
returns the path string. When omitted, returns the screenshot as
an MCP ImageContent block — the LLM SEES the captured pixels
directly.
Captures the real screen of the machine this server runs on (all monitors combined by default).
The image block returned to the model is scaled down when it is larger
than DPTTOOLS_IMAGE_MAX_EDGE_PX (1568 px on the long edge by default)
or DPTTOOLS_IMAGE_MAX_MB (3 MB); a file saved to output_path
keeps full resolution.
Requires the mss and Pillow libraries. Install the
[screenshot] extra.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_path
|
str | None
|
Path to save the screenshot as PNG. If omitted, returns a vision-readable image block. |
None
|
monitor
|
int | None
|
Monitor index to capture. 0 = all monitors combined (default), 1 = first monitor, 2 = second, etc. |
None
|
region
|
dict | None
|
Region to capture as |
None
|
Returns:
| Type | Description |
|---|---|
Image | str
|
File path string (when |
Image | str
|
ImageContent block (when |
Image | str
|
returns a plain string starting with |
take_window_screenshot(window_title, output_path=None)
¶
Capture a specific window by title.
Note: window-specific capture is not implemented yet, because it is not
reliable across platforms. Use take_screenshot() with a region
parameter for targeted captures.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
window_title
|
str
|
Title of the window to capture. |
required |
output_path
|
str | None
|
Path to save the screenshot (optional; returns a vision-readable image block if omitted). |
None
|
Returns:
| Type | Description |
|---|---|
str
|
An error message explaining the limitation, with a suggestion to use |
str
|
take_screenshot with a region parameter instead. |