diff --git a/openai/openclaw-tools/server.js b/openai/openclaw-tools/server.js index b9d2e59..631150d 100644 --- a/openai/openclaw-tools/server.js +++ b/openai/openclaw-tools/server.js @@ -185,15 +185,21 @@ function buildServer() { // --- browser -------------------------------------------------------------- server.registerTool('browser_invoke', { description: - 'Generic pass-through to the OpenClaw gateway "browser" agent tool (agent-controlled Chrome/Brave/Edge ' + - 'automation: tabs, snapshot, click, type, screenshot). Unlike cron/nodes, "browser" is NOT in the ' + - 'gateway HTTP default hard-deny list, so this can work as soon as the gateway is up and its normal ' + - 'tools.* policy allows "browser" for the caller — no special P6 HTTP-deny override needed. Args are ' + - 'forwarded verbatim as the tool call payload; the exact action/argument vocabulary is defined by the ' + - 'running gateway and needs live introspection once it exists (deferred to P6/P7).', + 'Drive the OpenClaw gateway "browser" tool (a headless Chromium the agent controls). ' + + 'TOP-LEVEL actions (the "action" arg): status, start, stop, profiles, tabs, open, navigate, ' + + 'snapshot, screenshot, act, console, dialog, pdf, upload. ' + + 'IMPORTANT: there is NO top-level "click"/"type"/"fill"/"evaluate" action — ALL page ' + + 'interactions go through action="act" with args={kind, ref, ...}. ' + + 'Typical flow: action="open" {url} -> action="snapshot" to get element refs (e.g. "e59") -> ' + + 'action="act" to interact. Interaction args examples: ' + + 'type text -> {kind:"type", ref:"e59", text:"hello"}; ' + + 'click -> {kind:"click", ref:"e33"}; ' + + 'fill -> {kind:"fill", ref:"e65", text:"secret"}; ' + + 'also kind can be hover|select|press|scrollIntoView|drag|evaluate. ' + + 'Refs go stale after navigation/DOM change — if an action reports "ref not found", re-snapshot.', inputSchema: { - action: z.string().describe('Browser tool action, e.g. "status", "open", "snapshot", "click", "type".'), - args: z.record(z.string(), z.unknown()).optional().describe('Action-specific parameters object.'), + action: z.string().describe('Top-level browser action: open | navigate | snapshot | screenshot | act | tabs | status | start | stop | profiles | console | dialog | pdf | upload. Use "act" for ALL page interactions (click/type/fill), never "click"/"type" directly.'), + args: z.record(z.string(), z.unknown()).optional().describe('Action params. action="open": {url, label?}. action="act": {kind:"type"|"click"|"fill"|"hover"|"select"|..., ref:"eN" from snapshot, text:"..." for type/fill}. action="snapshot": {refs:"aria"} for stable refs.'), }, }, async ({ action, args }) => invokeGatewayTool('browser', action, args || {}));