|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Internet and Network > MCP. - MCP (Model-Context Protocol) server operations > Screenshot Tools - Screen capture operations > MCP Commands - Screenshot Tools |
MiniRobot Language (MRL) - MCP Screenshot Tools Commands
MCP.ShotSetParseMode / SHOT.SETPARSEMODE
Set Screenshot Parse Mode
Purpose
The SHOT.SETPARSEMODE command configures how screenshot data is processed and formatted when returned by the MCP server. This setting affects how the image data is encoded, compressed, and presented in responses, allowing optimization for different use cases such as network transmission, storage efficiency, or processing requirements.
This command is particularly useful when:
• Optimizing screenshot data for network transmission
• Reducing storage requirements for captured images
• Preparing screenshots for specific processing pipelines
• Controlling image quality vs size trade-offs
• Integrating with external image analysis tools
Syntax
SHOT.SETPARSEMODE|$$MODE|$$RETURN_VAR
Parameters
$$MODE - The parse mode to set. Valid modes include: 0=File path only, 1=Base64 encoded, 2=Compressed, 3=Thumbnail preview. The availability of modes depends on the server configuration.
$$RETURN_VAR - The variable that will receive the result (1 for success, 0 for failure).
Parse Modes
0 - File Path Only
Returns only the file system path to the saved screenshot. This is the most efficient mode for local processing where the image file can be accessed directly.
1 - Base64 Encoded
Returns the screenshot as a Base64-encoded string. Useful for embedding images directly in JSON responses or transmitting over protocols that do not support binary data.
2 - Compressed
Returns the screenshot with additional compression applied. Optimizes for network transmission at the cost of some processing overhead.
3 - Thumbnail Preview
Returns a reduced-size thumbnail version of the screenshot. Useful for quick previews or when full resolution is not required.
Return Value
1 - The parse mode was successfully configured
0 - Failed to set the parse mode (invalid mode or unsupported)
Examples
' Example 1: Set Base64 mode for embedded transmission
SHOT.SETPARSEMODE|1|$$Result
IVV.$$Result!0
PRT.Base64 parse mode enabled
ELS.
PRT.Failed to set parse mode
EIF.
' Example 2: Use thumbnail mode for quick preview
' First, get a quick thumbnail
SHOT.SETPARSEMODE|3|$$ThumbSet
SHOT.SCREEN|$$ThumbPath
PRT.Thumbnail: $$ThumbPath
' Switch back to full mode for detailed capture
SHOT.SETPARSEMODE|0|$$FullSet
SHOT.SCREEN|$$FullPath
' Example 3: Configure compressed mode for network transfer
SHOT.SETPARSEMODE|2|$$CompressSet
IVV.$$CompressSet!0
PRT.Compressed mode active - optimized for network
ELS.
PRT.Compression mode not available
EIF.
Remarks
The parse mode setting persists for the duration of the MCP server session or until changed by another SHOT.SETPARSEMODE command. By default, parse mode is typically set to 0 (File Path Only) for maximum efficiency.
Base64 encoding increases the data size by approximately 33% compared to raw binary, but enables transmission over text-based protocols. Compressed mode may use various compression algorithms depending on the server configuration.
MCP.ShotSetParseMode and SHOT.SETPARSEMODE are aliases for the same command. You can use either form.
Error Conditions
The command will fail with an error if:
• The mode parameter is missing or invalid
• The return variable parameter is missing
• The ScreenshotTools feature is disabled in the server configuration
• The requested parse mode is not available on the system
See also:
• SHOT.SETCAPTUREMODE - Set Capture Mode
• SHOT.SETFALLBACK - Set Fallback Mode
• SHOT.SCREEN - Capture Screenshot