Skip to content

Commit 800892c

Browse files
committed
fix(mcp): improve takeScreenshot tool description to reduce model confusion
Clarify that the screenshot targets the editor application window (not a web page), describe the visible UI components and what the live preview panel renders, and explain that purePreview shows the page as it would appear in a real browser.
1 parent 85b17b0 commit 800892c

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

src-node/mcp-editor-tools.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,18 @@ function createEditorMcpServer(sdkModule, nodeConnector, clarificationAccessors)
8686

8787
const takeScreenshotTool = sdkModule.tool(
8888
"takeScreenshot",
89-
"Take a screenshot of the Phoenix Code editor window. " +
90-
"By default returns the screenshot as a PNG image inline. " +
91-
"If filePath is specified, saves the screenshot to that file and returns the file path instead. " +
92-
"Prefer capturing specific regions instead of the full page: " +
93-
"use selector '#panel-live-preview-frame' for the live preview content, " +
94-
"or '.editor-holder' for the code editor area. " +
95-
"Only omit the selector when you need to see the full application layout. " +
96-
"Note: live preview screenshots may include Phoenix toolbox overlays on selected elements " +
97-
"and other editor UI elements. Use purePreview=true to temporarily hide these overlays.",
89+
"Take a screenshot of the Phoenix Code editor application window or the live preview within it (not a web page). " +
90+
"The editor window contains: a toolbar at the top, a file tree sidebar on the left, " +
91+
"the code editor area in the center, and optionally a live preview panel on the right " +
92+
"that renders the HTML/CSS/JS output of the currently edited file in a browser view. " +
93+
"By default captures the entire editor window and returns the screenshot as an inline PNG image. " +
94+
"If filePath is specified, saves to that file and returns the path instead. " +
95+
"Prefer capturing specific regions using the selector parameter instead of the full window: " +
96+
"use '#panel-live-preview-frame' to capture only the live preview content, " +
97+
"or '.editor-holder' to capture only the code editor area. " +
98+
"Only omit the selector when you need to see the full editor application layout. " +
99+
"Note: live preview screenshots may include Phoenix toolbox overlays on selected elements. " +
100+
"Use purePreview=true to temporarily hide these overlays and render the page as it would appear in a real browser.",
98101
{
99102
selector: z.string().optional().describe("CSS selector to capture a specific element. Use '#panel-live-preview-frame' for the live preview, '.editor-holder' for the code editor."),
100103
purePreview: z.boolean().optional().describe("When true, temporarily switches to preview mode to hide element highlight overlays and toolboxes before capturing, then restores the previous mode."),

0 commit comments

Comments
 (0)