list_youtube_playlists
Retrieve all YouTube playlists linked to a connected account by providing the account ID.
Instructions
List YouTube playlists for a connected YouTube account
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| socialMediaId | Yes | YouTube account ID (from list_accounts) |
Implementation Reference
- src/tools/accounts.ts:59-67 (handler)The handler function for the 'list_youtube_playlists' tool. It takes a socialMediaId (UUID), calls the API endpoint to fetch YouTube playlists, and returns the JSON result.
async (input) => { const data = await client.get<YouTubePlaylist[]>( `/social-media/${input.socialMediaId}/youtube-playlists`, ); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, - src/tools/accounts.ts:53-58 (schema)Input schema for the 'list_youtube_playlists' tool: requires socialMediaId (UUID string) describing the YouTube account ID from list_accounts.
{ socialMediaId: z .string() .uuid() .describe('YouTube account ID (from list_accounts)'), }, - src/tools/accounts.ts:50-68 (registration)Registration of the 'list_youtube_playlists' tool using server.tool() with its name, description 'List YouTube playlists for a connected YouTube account', input schema, and handler.
server.tool( 'list_youtube_playlists', 'List YouTube playlists for a connected YouTube account', { socialMediaId: z .string() .uuid() .describe('YouTube account ID (from list_accounts)'), }, async (input) => { const data = await client.get<YouTubePlaylist[]>( `/social-media/${input.socialMediaId}/youtube-playlists`, ); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - src/index.ts:17-19 (registration)Registration call: registerAccountTools(server, client) which sets up this tool along with other account tools on the MCP server.
registerPostTools(server, client); registerAccountTools(server, client); registerFileTools(server, client); - src/types.ts:70-76 (helper)The YouTubePlaylist type definition used as the return type for the playlists API call, containing id, playlistId, title, description, and thumbnailUrl fields.
export interface YouTubePlaylist { id: string; playlistId: string; title: string; description: string | null; thumbnailUrl: string | null; }