Skip to content

Commit aa8bcc0

Browse files
Update src/McpResponse.ts
Co-authored-by: Nikolay Vitkov <[email protected]>
1 parent f121016 commit aa8bcc0

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/McpResponse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export class McpResponse implements Response {
184184
new TextEncoder().encode(formatA11ySnapshot(snapshot.root)),
185185
this.#snapshotParams.filePath,
186186
);
187-
formattedSnapshot = `Saved screenshot to ${this.#snapshotParams.filePath}.`;
187+
formattedSnapshot = `Saved snapshot to ${this.#snapshotParams.filePath}.`;
188188
} else {
189189
formattedSnapshot = formatA11ySnapshot(snapshot.root);
190190
}

src/tools/screenshot.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export const screenshot = defineTool({
1515
description: `Take a screenshot of the page or element.`,
1616
annotations: {
1717
category: ToolCategory.DEBUGGING,
18-
readOnlyHint: true,
18+
// Not read-only due to filePath param.
19+
readOnlyHint: false,
1920
},
2021
schema: {
2122
format: zod

src/tools/snapshot.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export const takeSnapshot = defineTool({
1515
identifier (uid). Always use the latest snapshot. Prefer taking a snapshot over taking a screenshot.`,
1616
annotations: {
1717
category: ToolCategory.DEBUGGING,
18-
readOnlyHint: true,
18+
// Not read-only due to filePath param.
19+
readOnlyHint: false,
1920
},
2021
schema: {
2122
verbose: zod

tests/McpResponse.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ uid=1_0 RootWebArea "My test page"
139139
result[0].text,
140140
`# test response
141141
## Page content
142-
Saved screenshot to ${filePath}.`,
142+
Saved snapshot to ${filePath}.`,
143143
);
144144
});
145145
const content = await readFile(filePath, 'utf-8');

0 commit comments

Comments
 (0)