vercel-labs/agent-browser · error
The "goto" action requires a url.
Error message
The "goto" action requires a url.
What it means
The eve 'navigate' tool maps action 'goto' to 'agent-browser open <url>'. url is optional in the schema only because the other actions (back/forward/reload) take none; execute() throws when action is 'goto' and url is undefined so the CLI never receives a argument-less open.
Source
Thrown at packages/@agent-browser/eve/extension/tools/navigate.ts:19
import { defineTool } from "eve/tools";
import { z } from "zod";
import { runBrowser } from "../lib/browser";
export default defineTool({
description:
"Navigate the sandboxed browser: open a URL, or go back/forward/reload. Launches the browser on first use. After navigating, call the snapshot tool to see the page.",
inputSchema: z.object({
action: z
.enum(["goto", "back", "forward", "reload"])
.default("goto")
.describe('"goto" opens the given URL; the others act on history.'),
url: z.string().optional().describe('Required when action is "goto".'),
}),
async execute({ action, url }, ctx) {
if (action === "goto") {
if (url === undefined) {
throw new Error('The "goto" action requires a url.');
}
return await runBrowser(ctx, ["open", url]);
}
return await runBrowser(ctx, [action]);
},
});
View on GitHub (pinned to 548b159b30)
Solutions
- Provide the url: tools.navigate({ action: 'goto', url: 'https://example.com' })
- Or omit action entirely (it defaults to 'goto') but always include url
- Use action 'reload'/'back'/'forward' when you do not want navigation to a URL
Example fix
// before
await tools.navigate({ action: "goto" });
// after
await tools.navigate({ action: "goto", url: "https://example.com" }); Defensive patterns
Strategy: validation
Validate before calling
if ((input.action ?? "goto") === "goto" && input.url === undefined) {
throw new Error("navigate to a URL requires the url field");
} Type guard
function canNavigate(i: { action?: string; url?: string }): boolean {
const action = i.action ?? "goto";
return action !== "goto" || i.url !== undefined;
} Prevention
- Remember action defaults to 'goto' — supplying url is what makes the call valid
- Resolve URL variables before building the tool call
- Use back/forward/reload explicitly when no url is intended
When it happens
Trigger: Invoking navigate with { action: 'goto' } and no url; explicitly passing action: 'goto' while the url lives in an undefined variable; empty-string url is allowed by the schema but only undefined triggers this guard.
Common situations: Agents defaulting action to 'goto' without supplying the target; template code where the URL variable failed to resolve.
Related errors
- The "${action}" action requires a value.
- The "${property}" property requires a selector.
- The "attr" property requires an attribute name.
- Provide a direction to scroll, or a selector to scroll into
- The "switch" action requires a target tab id or label.
AI-assisted analysis of vercel-labs/agent-browser@548b159b30 (2026-08-16).
Data as JSON: /api/errors/2ab82d927cb685d7.
Report an issue: GitHub.