Chatbot Tools
Chatbot tools let you configure the brand's AI agent, add knowledge documents, and diagnose why the AI gave an unexpected answer. These tools are how you set up and maintain automated customer support from an MCP client.
Overview
The Chatbot tool category covers Yaplet's AI agent — the one the dashboard calls Vex. You can change its settings, feed it knowledge through documents, and investigate when it gives a wrong or unexpected answer.
Vex — shown as Vex AI in the permission list.manage_chatbot_document still writes a document against a chatbotId, so the tool's shape has not changed — but what you add lands in the brand's pool, which is what the brand's chat AI, its phone agents and its AI social posting all read from. In the dashboard those documents appear on Brand → Knowledge.manage_chatbot
Creates a new AI agent or updates an existing one's settings.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | No | Chatbot ID. Omit to create, provide to update. |
name | string | Conditional | Display name. Required when creating. |
active | boolean | No | Enable or disable the agent. |
noContextBehavior | string | No | What the AI does when it can't find relevant knowledge: "decline" (politely refuse) or "offer_agent" (offer a human via a Yes/No prompt, and only while an agent is actually online). |
allowAgentRequest | boolean | No | Whether the AI can hand off to a human agent. Update only. |
agentRequestThreshold | number | No | Number of messages before auto-handoff (1–20). Update only. |
agentRequestMessage | string | No | Message shown to the visitor when handing off. Update only. |
How It Works
Creating an agent:
- Only
nameis required. The agent is created with sensible defaults:- Type: AI
- No-context behavior:
decline(politely refuse unknown questions) - Agent handoff: enabled, threshold of 6 messages
- Reranking: enabled (smart answer matching)
- Privacy masking: disabled
- The agent starts inactive by default. Set
active: trueto enable it immediately.
Updating an agent:
- Provide the
idand only the fields you want to change. - The
noContextBehaviorsetting is the one that most affects answer quality:"decline"— The AI politely says it doesn't have information on that topic. This is the safe default."offer_agent"— The AI offers to connect the visitor with a human. It needs agent handoff switched on; if handoff is off, the setting quietly falls back todecline.
- The parameters above are the only agent settings any tool can write. In particular, nothing here changes the agent's answer instructions (its free-text prompt) or its emoji setting — the two settings that decide how it writes. Those are edited on Brand → Vex → Personality.
manage_chatbot does not set the brand, so a brand-new agent created through MCP will not appear under Brand → Vex and no widget will use it. Create the agent on the Brand → Vex page instead, then use these tools to configure it and fill its knowledge.Example Prompts
- "Activate my AI agent."
- "Set my agent to hand off to a human after 3 unanswered messages."
- "Change the no-context behavior to decline instead of offering an agent."
- "Disable agent handoff."
- "Set the agent handoff message to 'Let me connect you with a support specialist.'"
- "Rename my AI agent to 'Ada'."
- "Turn my AI agent off for now."
manage_chatbot_document
Creates or updates a text document in the brand's knowledge. Documents are automatically processed so the AI can use them to answer questions.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | No | Document ID. Omit to create, provide to update. |
chatbotId | string | Conditional | Required when creating. The AI agent this document is filed under. |
name | string | Conditional | Document title. Required when creating. |
content | string | Conditional | Document content (text/HTML). Required when creating. |
How It Works
Creating a document:
- Provide
chatbotId,name, andcontent. - The content is sanitized, split into chunks and indexed so the AI can retrieve it when answering questions.
- Once indexed, the AI can immediately use this knowledge — on chat, on the phone, in suggested inbox replies, and in AI social posts.
Updating a document:
- Provide the
idand the fields to change (nameand/orcontent). - On update, the old index entries are deleted and rebuilt from the new content.
- This means changes take effect immediately — the AI uses the updated knowledge right away.
diagnose_ai_response identifies a knowledge gap. If the AI couldn't answer a question because it lacked information, you can immediately add a document to fix it.Example Prompts
- "Add a document explaining our refund policy: customers can get a full refund within 30 days."
- "Create a knowledge document about our pricing tiers."
- "Update the shipping policy document with the new international shipping rates."
- "Rename the FAQ document to 'Frequently Asked Questions - 2026'."
- "Add a document covering these topics: account setup, password reset, and billing questions."
- "Fix the knowledge gap — add a document about our return process." (typically follows a diagnose step)
diagnose_ai_response
Analyzes why the AI gave a specific answer. Returns a detailed diagnostic report with the question asked, the answer given, the knowledge it actually read, the agent's settings, and actionable suggestions.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
messageId | string | Yes | The ID of the AI chatbot's answer message to diagnose. |
How It Works
- Finds the AI interaction linked to the message — the visitor's question, the AI's answer, the search queries it ran, the exact text of every knowledge chunk it read with a relevance score, any API tool it called with what it sent and got back, and the model used.
- Classifies the outcome — Was the answer based on relevant knowledge? Did the AI lack context? Was the visitor handed off to a human agent? Did a technical error occur?
- Reports the settings that may have contributed, including the agent's full answer instructions verbatim, its no-context behavior, its handoff configuration, whether smart answer matching is on, and whether privacy masking is on.
- Provides actionable suggestions — typically recommending that you add a knowledge document to fill the gap, or adjust the agent's settings.
How to Get the Message ID
Use get_conversation_messages to read the messages in a conversation. AI answers are clearly identified in the results. The message id of an AI answer is what you pass to diagnose_ai_response. For answers given before Yaplet started linking AI events to messages, the tool cannot analyze them automatically — instead it hands you a direct link to that brand's Vex → Reports page, where you can find the answer in the table and expand its row to see the same detail.
Example Prompts
- "The AI gave a wrong answer in conversation X. Can you diagnose what happened?" (reads messages first, finds the AI answer, then diagnoses)
- "Why did the AI fail to answer the customer's question about pricing?"
- "Diagnose the AI response for the message where it talked about shipping."
- "Check why the AI escalated to a human agent in the latest conversation."
- "The AI said something incorrect — diagnose it and fix the knowledge." (diagnoses, identifies the gap, then uses
manage_chatbot_documentto add the missing info)
Common Workflow Patterns
Complete AI Agent Setup
- Create the agent on Brand → Vex (in the dashboard, so it belongs to your brand)
- Add knowledge documents →
manage_chatbot_document(repeat for each topic) - Activate →
manage_chatbotwithactive: true
Example prompt: "Add documents about our refund policy and shipping info to my AI agent, then activate it."
Diagnose and Fix
- Find the conversation →
search_conversationsorlist_records - Read the messages →
get_conversation_messages - Diagnose the AI answer →
diagnose_ai_response - Fix the knowledge gap →
manage_chatbot_document
Example prompt: "Find conversations where the AI failed, diagnose the most recent one, and add a document to fix the issue."