Skip to content

Commit 4950312

Browse files
semikolonclaude
andcommitted
docs: add token optimization section to README
Document the fork's token optimization features: - Snapshot truncation via maxLength parameter - Future enhancement infrastructure (expectation schema) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 36275b8 commit 4950312

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Chrome DevTools for reliable automation, in-depth debugging, and performance ana
1919
- **Reliable automation**. Uses
2020
[puppeteer](https://github.com/puppeteer/puppeteer) to automate actions in
2121
Chrome and automatically wait for action results.
22+
- **Token-efficient responses** (fork enhancement): Minimize token usage with
23+
snapshot truncation via `maxLength` parameter. Inspired by
24+
[fast-playwright-mcp](https://github.com/nicobailon/fast-playwright-mcp).
2225

2326
## Disclaimers
2427

@@ -319,9 +322,33 @@ Check the performance of https://developers.chrome.com
319322

320323
Your MCP client should open the browser and record a performance trace.
321324

322-
> [!NOTE]
325+
> [!NOTE]
323326
> The MCP server will start the browser automatically once the MCP client uses a tool that requires a running browser instance. Connecting to the Chrome DevTools MCP server on its own will not automatically start the browser.
324327
328+
## Token Optimization (Fork Enhancement)
329+
330+
This fork includes token optimization features inspired by [fast-playwright-mcp](https://github.com/nicobailon/fast-playwright-mcp).
331+
332+
### Snapshot Truncation
333+
334+
Use the `maxLength` parameter with `take_snapshot` to limit output size:
335+
336+
```
337+
Take a snapshot with maxLength of 5000 characters
338+
```
339+
340+
The snapshot will be truncated with a notice if it exceeds the limit. This is useful for large pages where you only need a summary.
341+
342+
### Future Enhancements
343+
344+
The infrastructure for more token optimization features is in place:
345+
346+
- **expectation schema**: Control which content to include in responses (snapshot, console, network, tabs)
347+
- **snapshotOptions**: Limit snapshot scope by CSS selector or max length
348+
- **imageOptions**: Control screenshot format, quality, and dimensions
349+
350+
See `src/expectation.ts` for the full schema and tool defaults.
351+
325352
## Tools
326353

327354
If you run into any issues, checkout our [troubleshooting guide](./docs/troubleshooting.md).

0 commit comments

Comments
 (0)