-
Notifications
You must be signed in to change notification settings - Fork 2k
lighthouse_audit and take_memory_snapshot incorrectly annotated with readOnlyHint: true #1767
Description
Description:
Both lighthouse_audit and take_memory_snapshot are annotated with readOnlyHint: true but perform mutating operations.
lighthouse_audit (src/tools/lighthouse.ts)
In the default navigation mode, this tool:
- Reloads the page via Lighthouse's navigation() function
- Mutates emulation settings (viewport, device scale factor, form factor)
- Writes report files to disk
The code acknowledges the mutation by calling context.restoreEmulation(page) in a finally block.
take_memory_snapshot (src/tools/memory.ts)
This tool calls captureHeapSnapshot({path: request.params.filePath}) which:
- Writes a .heapsnapshot file to the local filesystem at a user-specified path
- Triggers garbage collection
Per the MCP spec, readOnlyHint: true means "the tool does not modify its environment." Page reloads, emulation changes, and filesystem writes are environment modifications.
Impact
MCP clients use readOnlyHint to decide whether to auto-approve tool calls. These false annotations can cause page reloads and disk writes without user confirmation.
Suggested fix
Remove readOnlyHint: true from both tools or set it to false.