Client-Side Action
Ask code on your embedding page to perform a named client-side action and return a result to the agent.
Client-Side Action connects an agent to a function that your embedding page owns. Configure an action name, a description that tells the model when it should call the action, and typed string, number, or boolean parameters. The configuration dialog generates an example using window.agentstack.registerTools(...); register a matching handler in the parent page and return a JSON-serializable result.
When the agent invokes the action, the widget asks the embedding page to run that registered handler. The host site—not AgentStack’s server—owns the side effect and result. Required parameters are validated before the request, and the widget waits only a limited time for the host response. Design the handler to fail clearly and to protect any privileged client-side behavior. Do not assume it has generic browser permissions or that a host result is guaranteed.
Client-Side Action is high risk. In widget chat with action approval enabled, visitors confirm it before it proceeds. It is widget-only and is not available in email, Slack, REST, or MCP flows. Test it on the real embedding page because Playground and other contexts cannot prove that your host handler is registered correctly.