when using agent tools, for native tools , it's ok...
# ask-ai
f
when using agent tools, for native tools , it's ok to add some say method in it. how to do the same using mcp tools?
t
Thanks for reaching out, Deo. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're asking how to get an MCP tool to make the agent "say" something the same way a native tool can. Short answer: you cannot call
say
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