Test and troubleshoot page tools
A checklist to run before launch, the toolResult event, and fixes for common problems.
Last updated
Try every tool the way a visitor would before you launch. While you test, turn on Show actions (the deployment's Chat widget tab → Behavior) so each call shows as a card.
Checklist#
- Each tool: ask for it in plain words. The card reads Completed and the answer uses the result.
- Tools that ask first: Approve runs the tool; Reject doesn't, and the card reads Denied.
- Forms: the agent fills them in; with
toolautosubmitthe form is submitted; password fields stay empty. - Reload mid-call: start a slow tool and reload the page. The card reads Not completed, and the tool doesn't run twice.
- Stop: start a slow tool and select Stop. The card reads Not completed, and the agent doesn't reply.
- A new message mid-call: the tool stops and the agent answers the new message.
- Changing pages: move to a page without a tool and ask for it again. The agent says it can't do that there.
- Two tabs: open your site in two tabs and send from one. Only that tab runs the tool.
- Failures: make a tool throw. The card reads Error, and the agent explains.
- Your team's view: find the conversation in Inbox, and the tool in the Tools column of Analytics → AI Model.
Test in Chrome, Safari and Firefox, and on a phone.
Follow every call with the toolResult event#
js
const chat = await HelpAI.ready();
chat.on('toolResult', ({ toolCallId, name, status, durationMs }) => {
analytics.track('help_ai_tool', { name, status, durationMs });
});The event never carries the input or the result. Answering one of the agent's questions in the chat fires it too, with only toolCallId.
Common problems#
When you report a problem#
Include:
- The conversation id:
(await HelpAI.ready()).state.conversationIdin the browser console. - The request body of
/pai/stream-message(DevTools → Network), which lists the tools the message offered inclientTools. - Any warnings in the browser console, and a screenshot of the card.
The full reference ships with the widget: page tools guide (opens another site).