few-analyst-46
12/08/2025, 1:25 AMtall-airline-16756
12/08/2025, 1:26 AMtall-airline-16756
12/08/2025, 1:26 AMsay directly from an MCP tool. Here are two practical ways to achieve the same outcome.
Options:
• Return a spoken-text string from the MCP tool and prompt the LLM to speak it.
a. Have the MCP tool return a natural-language field (e.g., "spoken": "...").
b. In the agent/system prompt or tool description instruct the LLM to use that field as the agent's reply (e.g., "If a tool returns spoken, respond to the user by saying that text conversationally").
c. The agent will then generate a reply the same way it handles other tool outputs.
• Use a native tool when you need direct speech control.
◦ Implement session.say() or session.generate_reply() inside a native tool for precise behavior (audio playback, interrupts, TTS settings).
◦ Call that native tool from the agent after receiving MCP results, or perform the speech action entirely within the native tool.
If you want, tell me:
• Do you need plain text speech (LLM to verbalize) or programmatic audio control (play/interrupt/adjust TTS)?
• An example MCP tool response you plan to return — I can suggest the exact prompt or tool-output format to ensure the agent speaks it. Sources: Tool definition and use | LiveKit docs | Agent speech and audio | LiveKit docs