Esta página no está disponible en español. Se muestra la versión en inglés.

YouTube connector

Search videos, read channels and playlists, and manage comments, ratings, and subscriptions through the YouTube Data API.

En esta página

The youtube connector gives workflows access to YouTube through the YouTube Data API v3. Look up channels and videos, search, read playlists and comments, reply to comments, and manage subscriptions. Two tools read a channel's public feed and need no sign-in, so you can watch for new uploads without using API quota.

Prerequisites

  • A Google account that can approve YouTube access (for every tool except the two listed below).
  • The project_contributor role or higher in your project.
  • A workspace selected in the Console header.

The tools youtube_resolve_channel_id and youtube_list_channel_videos_rss use public pages and the public channel feed, not the YouTube Data API, so they need no token. Every other tool needs a YouTube access token on the active profile.

Connect in AgentRuntime

The simplest route is to sign in with Google. One Google connection can also serve other Google connectors; see Google Workspace.

  1. Sign in with Google

    Open Connections and click Sign in with Google. Enter a Display name, tick YouTube in the services list, and click Continue to Google. Choose your account and approve the permissions.

  2. Add the connector

    Click MCP in the sidebar, click Add connectors, find youtube, select it, and click Add to workspace.

  3. Attach the Google connection

    Open the new instance. On Instance config, click New profile, enter a Display name, and choose your Google account in the credentials section.

  4. Make the profile active

    Set Status to Active — can be used in workflows, click Save, then click Use this profile for workflows.

  5. Test it in a workflow

    In Workflow Studio, add a connector tool step for this instance and choose youtube_list_channel_videos_rss with a channel handle. Then try youtube_search or youtube_get_channel with mine set to true to confirm the signed-in account works.

If you already have a YouTube OAuth access token, you can instead choose Type secrets on this screen on Instance config and paste it into access_token. A pasted token expires, and you must replace it yourself.

See MCP instances for more on profiles.

What you can build

  • Channel digest. Run youtube_list_channel_videos_rss on a few channels each week, summarize the titles with an LLM step, and email the digest.
  • Comment triage. Run youtube_get_comment_threads on a new video, have an LLM flag spam or questions, send the questions to a person with a human step, then answer with youtube_reply_comment.
  • Topic research. Use youtube_search for a topic, read each hit with youtube_list_videos, and save the findings to a sheet.
  • Subscription sync. List current subscriptions with youtube_subscriptions_list, compare with a list you maintain, and add missing channels with youtube_subscriptions_insert.

Tools

Look up without signing in

ToolWhat it does
youtube_resolve_channel_idFinds a channel ID from an ID, an @handle, or a channel URL
youtube_list_channel_videos_rssLists a channel's recent videos from its public feed. channel_identifier and limit are required; a limit of 0 returns the whole feed

Read with a signed-in account

ToolWhat it does
youtube_searchSearches for videos, channels, or playlists (query required, optional type, order, max_results up to 50)
youtube_get_channelReturns a channel. Pass exactly one of channel_id, for_username, or mine set to true
youtube_get_videoReturns one video by video_id
youtube_list_videosReturns several videos by video_ids
youtube_list_channel_videosLists a channel's videos using search (channel_id required)
youtube_list_playlistsLists playlists for a channel_id, or for the signed-in account with mine set to true
youtube_list_playlist_itemsLists the entries in a playlist (playlist_id required)
youtube_get_comment_threadsLists comment threads for a video_id or a channel_id
youtube_subscriptions_listLists the signed-in account's subscriptions

Change data

ToolWhat it does
youtube_insert_commentPosts a top-level comment on a video (video_id and text)
youtube_reply_commentReplies to a comment (parent_comment_id and text)
youtube_rate_videoSets a rating on a video: like, dislike, or none to clear it
youtube_subscriptions_insertSubscribes the signed-in account to a channel (channel_id)
youtube_subscriptions_deleteRemoves a subscription by subscription_id
youtube_custom_api_callSends any YouTube Data API v3 request (method, path, optional query and body). Can change data

Reading tools also take paging inputs such as max_results and page_token, and some take part to choose which fields come back.

Example

Get the latest videos from a channel without using any quota:

{
  "id": "youtube_rss",
  "type": "mcp",
  "name": "Latest channel videos",
  "tool_name": "youtube_list_channel_videos_rss",
  "tool_args": {
    "channel_identifier": "@GoogleDevelopers",
    "limit": 5
  },
  "timeout_s": 30
}

Studio fills in instance_id when you pick the instance. The result has channel_id, count, and items, each with id, title, link, pubDate, and author. A later step can read {{steps.youtube_rss.result.items}}.

Configuration

KeyRequiredDefaultDescription
access_tokenFor all tools except the two public onesnoneA YouTube OAuth access token. Signing in with Google supplies it for you
api_baseNohttps://www.googleapis.com/youtube/v3The YouTube Data API address
user_agentNoagentruntime-mcp-youtube-go/1.0The User-Agent sent with requests
request_timeout_secondsNo30Time limit for each request, in seconds

Troubleshooting

IssueFix
resolved config is missing access_tokenThe tool needs a signed-in account. Attach your Google connection to the active profile, or use one of the two public tools
youtube api error 401The token is invalid or expired. Sign in with Google again, or replace a pasted token
youtube api error 403YouTube refused the request. Read the message that follows the code: it may be a quota limit, a missing permission, or comments turned off on the video. Use the RSS tool for simple "latest videos" checks, since it uses no quota
Channel not foundTry the @handle, the full channel URL, or the channel ID that starts with UC
Empty search resultsCheck query, type, and order. Set type to video, channel, or playlist
Editar esta páginaagentruntime-io/agentruntime-docs