Skip to content

Commit bee8cd1

Browse files
t3dotggclaude
andcommitted
docs(mcp): describe the snapshot cap in bytes
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 085e0e0 commit bee8cd1

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎apps/server/src/mcp/McpHttpServer.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ const McpAuthMiddlewareLive = HttpRouter.middleware<{
118118
* the agent a notice instead, so a snapshot that carries the full
119119
* accessibility tree and page text loses its locators too. Claude Code also
120120
* shows the model `structuredContent` in place of the text blocks when a
121-
* result has both, so both carry the same bounded snapshot. Keep it near 20k
122-
* characters and tell the agent what was cut.
121+
* result has both, so both carry the same bounded snapshot. Keep it near
122+
* 20 KB and tell the agent what was cut. The short `omitted` notes may go a
123+
* little over; the provider limit is far above this.
123124
*/
124125
export const MAX_SNAPSHOT_TEXT_BYTES = 20_000;
125126
const MAX_SNAPSHOT_VISIBLE_TEXT_CHARS = 8_000;

‎apps/server/src/mcp/toolkits/preview/tools.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const PreviewSetAppearanceTool = safeBrowserTool(
119119
export const PreviewSnapshotTool = readonlyBrowserTool(
120120
Tool.make("preview_snapshot", {
121121
description:
122-
"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 20k characters 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.",
122+
"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.",
123123
parameters: Schema.Struct({
124124
...PreviewAutomationTabTargetInput.fields,
125125
includeImage: Schema.optional(

0 commit comments

Comments
 (0)