Set chat hooks
MCP
set_chat_hooksWRITE$0.00001 / call
Features
Set pre-, post-, and streaming webhook URLs for the AI chatbot. Pass empty string to clear an individual hook.
Input4
Your API key, for the REST call. Sent from your browser straight to the API — never to Docsbook, never stored.
Numeric workspace id — OR the project as the user names it: 'owner/repo', the repo name alone, the site's display name, its docs URL or custom domain. Text is resolved server-side; an ambiguous name returns the candidates instead of guessing, so pass what the user said rather than calling list_workspaces first.
Pre-LLM hook URL — receives {question, session_id, workspace_id}, may return {block, reason} or {inject_context}
Post-LLM hook URL — fire-and-forget POST with {question, answer, tool_calls, latency_ms}
Streaming events webhook URL — fire-and-forget SSE-style events
Output5
null
null
null
Limitations
- REQUIRES the PRO plan or above.
Example input
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "set_chat_hooks",
"arguments": {
"workspace_id": "<workspace_id>"
}
}
}Example output
{
"status": "<status>",
"workspace_id": 0,
"ai_chat_pre_hook_url": "<ai_chat_pre_hook_url>",
"ai_chat_post_hook_url": "<ai_chat_post_hook_url>",
"ai_chat_streaming_webhook_url": "<ai_chat_streaming_webhook_url>"
}