Tools
Tools are the bridge between Pillar's co-pilot and your application. They represent things users can do — navigating to a page, opening a modal, filling a form, calling an API — and the co-pilot suggests them when relevant.
Without tools, the co-pilot can only answer questions. With tools, it becomes an assistant that does things on behalf of users.
| Without tools | With tools |
|---|---|
| "Here's how to invite a team member..." | "I can invite them for you. [Invite Team Member]" |
| User reads instructions, navigates manually | User clicks the tool, modal opens pre-filled |
How it works
- You define tools in your code with descriptions the co-pilot can understand
- A user asks a question ("How do I change my billing plan?")
- The co-pilot matches the intent to your "Upgrade Plan" tool
- The user clicks the suggested tool, and your handler runs
Tool types
| Type | What it does | Example |
|---|---|---|
navigate | Go to a page in your app | Settings, dashboard, detail pages |
trigger_tool | Run your custom logic | Open modals, start wizards, toggle features |
query | Fetch data from the client and return it to the agent | Search products, look up records |
open_modal | Open a modal or dialog | Confirmation forms, settings dialogs |
fill_form | Pre-fill form fields | Invite forms, transfer forms |
external_link | Open a URL in a new tab | Documentation, external resources |
copy_text | Copy text to clipboard | API keys, code snippets |
start_tutorial | Start a walkthrough | Onboarding tours |
inline_ui | Show interactive UI in chat | Confirmation cards, data previews |
Auto-run behavior
Some tools run automatically without user confirmation:
navigate,external_link, andcopy_texttools auto-run by default (safe, instant actions)- Other types like
trigger_tool,open_modal, andfill_formrequire user confirmation - Only the top-ranked tool in a response can auto-run, preventing multiple simultaneous actions
Setting autoRun: true on a tool enables auto-run for types that don't auto-run by default. Note that default auto-run types (navigate, external_link, copy_text) always auto-run when they are the top match — the default cannot be disabled per-tool.
Data extraction
When you register a tool on the client, you can define an inputSchema that tells the co-pilot what data to extract from the conversation. When a user says "invite sarah@acme.com as an admin," the co-pilot extracts { email: "sarah@acme.com", role: "admin" } and passes it to your client-side tool handler.
Context requirements
Tools can specify required context to only appear in relevant situations:
- An "Edit Project" tool only appears when
context.projectIdis set - An "Admin Settings" tool only appears when
context.userRole === 'admin'
This keeps suggestions relevant and prevents users from seeing tools they can't use.
Next steps
- Setting up tools — Step-by-step implementation guide
- Syncing tools — How to sync tools to Pillar's backend