Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): require explicit inline preview screenshots #11380

Closedyashranaway(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/11380/headopened View on GitHub

Showing 3 changed files with 58 additions and 50 deletions.

x
0 of 3 viewed, 3 left
3 additions and 3 deletionsapps/server/src/mcp/toolkits/preview/tools.tsModified
View file
@@ -119,19 +119,19 @@
export const PreviewSnapshotTool = readonlyBrowserTool(
Tool.make("preview_snapshot", {
description:
- "Inspect a page before interacting. Pass tabId to inspect a specific tab; omit it to use this agent session's current tab. Returns page state, semantic elements, diagnostics, action history, and a PNG screenshot. The text is capped near 20 KB and lists what it omitted; use preview_evaluate to read more. Set includeImage=false for text-only output with the same page metadata. Set save=true to also write the PNG to disk and get screenshotPath back; with includeImage=false, save=true returns only the url and screenshotPath. Embed that path in your reply as ![alt](screenshotPath) so the user sees it. This is the only way to show the user a screenshot; the image in the tool result is not saved anywhere.",
+ "Inspect a page before interacting. Pass tabId to inspect a specific tab; omit it to use this agent session's current tab. Returns page state, semantic elements, diagnostics, and action history as text by default. The text is capped near 20 KB and lists what it omitted; use preview_evaluate to read more. Set includeImage=true only when you need to inspect the screenshot visually; inline images remain in provider history. Set save=true to also write the PNG to disk and get screenshotPath back; without includeImage=true, save=true returns only the url and screenshotPath. Embed that path in your reply as ![alt](screenshotPath) so the user sees it. This is the only way to show the user a screenshot; the image in the tool result is not saved anywhere.",
parameters: Schema.Struct({
...PreviewAutomationTabTargetInput.fields,
includeImage: Schema.optional(
Schema.Boolean.annotate({
description:
- "Include the PNG image in the tool response. Defaults to true. Set false for text-only output.",
+ "Include the PNG image in the tool response. Defaults to false. Set true to include the image.",
}),
save: Schema.optional(
Schema.Boolean.annotate({
description:
- "Write the screenshot PNG to disk and return its absolute path as screenshotPath. With includeImage=false, return only the url and screenshotPath. Defaults to false.",
+ "Write the screenshot PNG to disk and return its absolute path as screenshotPath. Without includeImage=true, return only the url and screenshotPath. Defaults to false.",
}),
}),
51 additions and 43 deletionsapps/server/src/mcp/McpHttpServer.test.tsModified
View file
@@ -229,7 +229,7 @@
​