One tool registered. Strongest in trust, weakest in shared experience.
search_docs: registered at 1077ms// Register tools as soon as they're ready, not behind a deferred/async chunk.
document.modelContext.registerTool({ /* ... */ });search_docs// Make the tool's effect visible on the page the person is looking at:
// update the same UI your existing human flow uses when search_docs runs,
// so the person co-browsing sees what the agent just did.
execute: async (args, { signal }) => {
const result = await performAction(args, signal);
renderResultInPage(result); // the human-visible half of the same action
return result;
}{
"name": "search_docs",
"description": "Search the Clerk documentation. Returns the best-matching pages and sections, each with a title, heading, snippet, and URL.",
"inputSchema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "What to search for, e.g. \"protect a route\" or \"useUser\"."
},
"sdk": {
"type": "string",
"enum": [
"nextjs",
"react",
"expo",
"tanstack-react-start",
"react-router",
"expressjs",
"android",
"astro",
"chrome-extension",
"electron",
"fastify",
"go",
"ios",
"js-frontend",
"nuxt",
"ruby",
"vue"
],
"description": "Ranks this SDK's pages first and links to its variant of each page. Defaults to the SDK the user selected in the docs."
}
},
"required": [
"query"
]
},
"annotations": {
"readOnlyHint": true
}
}search_docs// Make the tool's effect visible on the page the person is looking at:
// update the same UI your existing human flow uses when search_docs runs,
// so the person co-browsing sees what the agent just did.
execute: async (args, { signal }) => {
const result = await performAction(args, signal);
renderResultInPage(result); // the human-visible half of the same action
return result;
}search_docs: registered at 1077ms// Register tools as soon as they're ready, not behind a deferred/async chunk.
document.modelContext.registerTool({ /* ... */ });