Skip to content

Decide browser_find file export and result-limit policy #256

Closed

Description

@JustasMonkev

Upstream change

Playwright PR #42968, released in MCP v0.0.83, adds an optional filename to browser_find. Both matching and no-match results can be written to a file instead of included inline. Upstream resolves relative names against the workspace root.

Why this needs a decision here

Our src/tools/snapshot.ts exposes text, regex and maxResults, but no filename. The recently completed #245 already provides bounded inline results, so file export is an additional product capability, not a broken existing contract. We also deliberately use output-directory containment, portable sanitized names and exclusive/no-clobber reservation rather than upstream workspace-relative paths. README documents that policy.

Decide whether callers need persistent find-result artifacts as well as bounded inline search, and whether a saved artifact respects maxResults or always contains every match. Adopting the upstream schema without resolving that interaction would leave ambiguous behavior.

Proposed action

If adopted, add optional filename without changing the existing no-filename response. Reuse context.outputFile and existing artifact-link conventions, preserve no-clobber/path rules, and document the intentional difference from upstream. Recommended behavior: apply maxResults identically to inline and saved results and retain the total-match/truncation summary.

Validate text and regex searches, no matches, bounded results, existing-file rejection, invalid filenames, write failures and link-only output with a saved artifact. Extend tests/tools-snapshot.test.ts and real filesystem coverage; update README's browser_find section. No package, binary or tool renaming is needed.

No implementation or runtime reproduction was performed during this monitoring run. This issue requests the export/limit policy decision rather than assuming optional upstream feature parity is mandatory.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions