Connect to custom tools
Connect GitBook Assistant to any tool you can call from your app — especially support workflows
Custom tools let the GitBook Assistant inside the Docs Embed run real actions.
You can connect it to any tool your app can access. That includes your backend APIs, third-party SDKs, and internal systems.
If your app can call it, the Assistant can call it.
Common examples:
Create or update support tickets on behalf of the user
Hand off to support by opening a support chat with a prefilled message
Support handoff is a great way to get started with custom tools. It’s the fastest way to unblock users.
Trigger product actions (reset MFA, resend an invite, enable a feature flag)
Look up account status in your backend
Kick off workflows in tools like Jira, Linear, Slack, or Zendesk
In addition to tools you define in the Embed config, the Assistant can also use any MCP servers you set up in Settings → AI & MCP.
Where tools run
The tool’s execute function runs in the same environment as your embed integration.
That usually means it runs in the user’s browser, inside your app.
So you can:
Call your own backend endpoints
Call any third-party SDK already loaded in your app (for example, Intercom)
Open modals, deep links, or in-product UI
Avoid putting secrets in client-side code — call your backend instead.
Add a tool
Define tools:
Via
window.GitBook("configure", …)for the script tag implementationVia the
toolsprop for the Node.js/NPM package and React components
Tools aren’t the same as embed actions.
Use actions for buttons the user clicks.
Use tools when you want the Assistant to choose and run code.
Tool template (resend an invite email)
Let’s look at an example:
How tools get used
Once you register tools, the Assistant can choose them automatically — based on the user’s question and your tool description.
If required fields are missing, the Assistant should ask follow-up questions.
If you add confirmation, the user must approve before the tool runs.
Tool fields
name: Unique identifier.description: The “when to use this” hint for the Assistant.inputSchema: JSON Schema for tool inputs.confirmation(optional): A confirmation button shown before the tool runs.execute(input): Async function that runs the action.Return
{ output, summary }.outputgoes back to the Assistant.summaryshows to the user.
Confirmation
Use confirmation when you want the user to approve an action. It helps prevent surprise side effects.
confirmation accepts:
label(required): Button text.icon(optional): A Font Awesome icon name.
Support workflow
Support is the highest-leverage use case for tools.
You can let the Assistant:
Collect missing details
Create a ticket in your system
Open a human support channel with context prefilled
Template: open support chat with a prefilled message
Use this when you want a clean handoff to a human.
Pair this with an always-visible Contact Support action in the embed sidebar. You can configure actions by following Customizing the Embed.
Next steps
Need the full embed API surface? See API Reference.
Want more UI controls (greeting, suggestions, actions)? See Customizing the Embed.
Last updated
Was this helpful?