TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/l-xiaoshen/handstage/llms.txt
Use this file to discover all available pages before exploring further.
@handstage/agent package ships a ready-made ToolSet that you can pass directly to the Vercel AI SDK. Each tool carries a description, a Zod input schema, and a Zod output schema — everything the AI SDK needs to present the tool to a language model and validate results. You supply the execution layer separately by implementing HandstagesAgentToolHandlers.
Exports
handstagesAgentTools
A ToolSet object (from the Vercel AI SDK’s ai package) that contains all 17 browser tools. Import it and pass it straight to generateText or streamText.
createHandstagesAgentToolDefinitions()
A function that returns the same ToolSet object as handstagesAgentTools. Use this form when you need a fresh reference on each call or prefer a function-based API.
Usage with the Vercel AI SDK
PasshandstagesAgentTools to generateText or streamText. Wire execution by providing each tool’s execute function via your HandstagesAgentToolHandlers implementation. See HandstagesAgentToolHandlers reference for the full wiring pattern.
handstagesAgentTools contains only the schema and description for each tool — no execution logic. You must attach execution via HandstagesAgentToolHandlers. See the handlers reference for a complete wiring example.Tool reference
All 17 tools are listed below. Each tool entry shows its input parameters and output shape.pages — list open browser tabs
pages — list open browser tabs
newPage — open a new browser tab
newPage — open a new browser tab
setActivePage — focus a browser tab
setActivePage — focus a browser tab
pageId. Use this after newPage or any time you switch context between tabs.Inputpages or newPage.ok is false.goto — navigate a tab to a URL
goto — navigate a tab to a URL
reload — reload the current document
reload — reload the current document
true, performs a hard reload that bypasses the browser cache.ok is true.ok is false.goBack — go back in history
goBack — go back in history
navigated field in the response tells you whether a back navigation actually occurred.Inputtrue if history navigation occurred; false if there was no previous entry. Only present when ok is true.ok is true.ok is false.goForward — go forward in history
goForward — go forward in history
goBack.Inputtrue if a forward entry was available and navigation occurred. Only present when ok is true.ok is true.ok is false.snapshot — capture the accessibility tree
snapshot — capture the accessibility tree
xpathMap that maps encoded node IDs in the tree to their XPath selectors, and a urlMap for link URLs.Inputtrue, includes accessibility nodes from embedded iframes. Defaults to false.ok is true.tree to their XPath selectors. Use these selectors with click_on, fill_on, type_on, or hover_on. Only present when ok is true.href values where applicable. Only present when ok is true.ok is false.pageInfo — get current URL and title
pageInfo — get current URL and title
ok is true.ok is true.ok is false.click — click at viewport coordinates
click — click at viewport coordinates
snapshot to retrieve coordinates from the accessibility tree, or use click_on to target by selector.Input"left".2 for double-click). Must be a positive integer.ok is true.ok is false.hover — move the pointer to viewport coordinates
hover — move the pointer to viewport coordinates
ok is true.ok is false.scroll — dispatch a mouse wheel event
scroll — dispatch a mouse wheel event
deltaY to scroll down and negative deltaY to scroll up.Inputok is true.ok is false.type — type text at the current focus
type — type text at the current focus
click_on) before calling this tool. For typing directly into a selector, use type_on instead.Inputtrue, simulates realistic typing with occasional mistakes and corrections.ok is false.click_on — click an element by selector
click_on — click an element by selector
snapshot.Input//button[@id='submit']). Must be non-empty.ok is false.fill_on — fill an input element by selector
fill_on — fill an input element by selector
type_on when you want to replace the entire field value atomically.Inputok is false.type_on — type into an element by selector
type_on — type into an element by selector
fill_on, this preserves any existing value and dispatches real key events, making it suitable for inputs that respond to keystroke-level events.Inputok is false.hover_on — hover an element by selector
hover_on — hover an element by selector
ok is false.