Six tools let any AI agent open a real browser, read the page, and act with Playwright.
// Supports Kernel, Browserbase, and more
const provider = new LocalBrowserProvider();
// Adapters for AI SDK, Pi, and MCP
const { tools } = createAiSdkBrowserTools(provider);
const result = await generateText({
model,
tools,
prompt: "Find the top story on Hacker News",
});Lets your agent work through complex pages with less overhead — and a lot less cost.
The agent reads a short page snapshot, then runs the Playwright code it needs.
Returns a compact accessibility tree with stable refs. The agent can read the page structure without raw HTML.
Runs Playwright code on the live page. Pass diffSnapshot to get a compact snapshot diff of what changed.
The package includes adapters for AI SDK, Pi, and MCP. The base tools are framework-neutral, so you can also wire them into your own agent loop.
Run Chromium on your machine with LocalBrowserProvider, or use the built-in providers for Libretto Cloud, Browserbase, Kernel, and Steel.
Most browser work needs two tools: browser_snapshot to read the page and browser_exec to run Playwright. The other four tools open, connect, inspect, and close browser sessions.
No. It gives an agent a small tool set and runs its browser_exec code through Playwright. You still have the Playwright API.
Yes. The package is available under the MIT license in the Libretto repository.
Install the package. Keep your current model and agent framework.