playlist_delete
Delete a saved playlist by name to remove unwanted playlist files from mpv media player, keeping your library organized.
Instructions
Delete a saved playlist file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Playlist name to delete |
Implementation Reference
- index.js:698-703 (handler)Handler for playlist_delete tool: constructs the playlist path, checks if it exists, deletes the file, and returns success or error.
case "playlist_delete": { const p = playlistPath(args.name); if (!fs.existsSync(p)) return fail(`Playlist "${args.name}" not found`); fs.unlinkSync(p); return ok(`Deleted playlist "${args.name}"`); } - index.js:487-497 (schema)Schema definition for playlist_delete tool: requires 'name' (string) as input.
{ name: "playlist_delete", description: "Delete a saved playlist file.", inputSchema: { type: "object", properties: { name: { type: "string", description: "Playlist name to delete" }, }, required: ["name"], }, }, - index.js:487-498 (registration)Tool registration: playlist_delete is part of the TOOLS array used in ListToolsRequestSchema handler.
{ name: "playlist_delete", description: "Delete a saved playlist file.", inputSchema: { type: "object", properties: { name: { type: "string", description: "Playlist name to delete" }, }, required: ["name"], }, }, ]; - index.js:280-282 (helper)Helper function that constructs the filesystem path for a playlist by sanitizing the name and appending .m3u extension.
function playlistPath(name) { return path.join(PLAYLIST_DIR, name.replace(/[/\\?%*:|"<>]/g, "_") + ".m3u"); }