MCP Tools
MCP (Model Context Protocol) tools allow Voice+ to go beyond simple conversations by invoking external flows that fetch live data, trigger actions, and even send commands back to the frontend. With MCP enabled, you can create dynamic, context-aware experiences that bridge Voice+ conversations with custom business logic.
Defining the Payload
Example Payloads
Sample Knowledge Base Response Handler
function handleCustomCommand(action, payload) {
// Example: Voice-enabled product search
if (action === "animalPolicy") {
setDogPolicy(payload.dog);
setCatPolicy(payload.cat);
}
}
const touchpointOptions = {
config: {
applicationUrl: "YOUR_APPLICATION_URL",
headers: {
"nlx-api-key": "YOUR_API_KEY",
},
languageCode: "en-US",
},
input: "voiceMini", // Enables voice input with bidirectional support
bidirectional: {
custom: handleCustomCommand,
},
};
Last updated