Connect Voice Agents to External Services with MCP

LiveKit
394 views February 10, 2026

👉 Sign up for LiveKit Cloud: https://cloud.livekit.io/signup?utm_source=youtube&utm_medium=video&utm_campaign=devrel&utm_content=lOACxaBLwSI Give your voice agent real capabilities by connecting it to external APIs and services. Learn how to build function tools and integrate with Model Context Protocol (MCP) servers for shared tool libraries. Turn your conversational agent into something that can actually get things done. This lesson covers building custom tools with the @function_tool decorator, integrating with MCP servers, and handling long-running operations gracefully. **What you'll learn:** - Why tools matter for production voice agents - Building your first function tool (weather lookup) - Connecting to MCP servers (LiveKit docs search) - Error handling with ToolError - Managing long-running tools with user feedback - Dynamic tool management at runtime **What you'll build:** - Weather lookup tool using Open-Meteo API - MCP integration with LiveKit documentation search - Error handling for invalid inputs - Feedback messages for long-running operations - Multi-tool agents that automatically select the right capability The LLM automatically decides which tool to call based on your docstrings and the conversation context. When a user asks "What's the weather in Tokyo?", the LLM reads your tool descriptions, selects the weather tool, extracts "Tokyo" as the location parameter, and calls your function. **Tool best practices:** - Write specific docstrings so the LLM knows when to call your tool - Keep tools fast (under 2 seconds) or provide feedback - Return meaningful data that helps the LLM craft responses - Use ToolError for graceful error handling MCP (Model Context Protocol) lets you connect to shared tool servers. You'll integrate with the LiveKit docs MCP server, turning your voice agent into a searchable interface for documentation. This is lesson 5 of the LiveKit Voice Agents workshop series. Your agent can now fetch real-time data, take actions in external systems, and access private information. 📚 Resources 📚 Agent docs: https://docs.livekit.io/agents/?utm_source=youtube&utm_medium=video&utm_campaign=devrel&utm_content=lOACxaBLwSI Written workshop: https://worksh.app/tutorials/livekit-voice-agent/introduction 🤝 Join the Community Slack: https://livekit.io/join-slack?utm_source=youtube&utm_medium=video&utm_campaign=devrel&utm_content=lOACxaBLwSI #livekit #ai #voiceai

Keyboard shortcuts

On. Switch them off if they collide with your assistive tools; ? still opens this sheet.

Go to

Press g then the letter.

  • gh Latest
  • gs Sources
  • gm Media
  • gv Videos
  • gp Podcasts
  • gc Calendar
  • gd Decoder
  • gz Dataviz
  • ga Datasets
  • gb Blog
  • gk Markets
  • gj Careers
  • gn Prompt Notebook

On this page

  • / Focus search, where there is one
  • t Back to top
  • ? This list
  • Esc Close