get_playlists
Retrieve all playlists from your Plex Media Server library.
Instructions
Get all Plex playlists
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/plex/tools.ts:278-298 (handler)The getPlaylists() method on PlexTools class - makes a GET request to /playlists endpoint and returns formatted playlist data including ratingKey, title, type, playlistType, smart flag, leafCount, duration, summary, and timestamps.
async getPlaylists(): Promise<MCPResponse> { const data = await this.client.makeRequest("/playlists"); const container = data as { MediaContainer?: { Metadata?: Record<string, unknown>[] } }; const playlists = container.MediaContainer?.Metadata || []; return jsonResponse({ playlists: playlists.map((playlist) => ({ ratingKey: playlist.ratingKey, key: playlist.key, title: playlist.title, type: playlist.type, playlistType: playlist.playlistType, smart: playlist.smart, leafCount: playlist.leafCount, duration: playlist.duration, summary: playlist.summary ? truncate(String(playlist.summary), SUMMARY_PREVIEW_LENGTH) : undefined, updatedAt: playlist.updatedAt, addedAt: playlist.addedAt, })), }); } - src/plex/tool-registry.ts:94-94 (registration)Registers the 'get_playlists' tool with the registry, wiring it to call tools.getPlaylists() with no arguments.
registry.register("get_playlists", () => tools.getPlaylists()); - src/plex/tool-schemas.ts:134-141 (schema)Defines the GET_PLAYLISTS_SCHEMA with name 'get_playlists', description 'Get all Plex playlists', and an empty inputSchema (no parameters required).
const GET_PLAYLISTS_SCHEMA = { name: "get_playlists", description: "Get all Plex playlists", inputSchema: { type: "object" as const, properties: {}, }, };