Skip to content

lighthouse_audit and take_memory_snapshot incorrectly annotated with readOnlyHint: true #1767

@AgentSeal

Description

@AgentSeal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions