player_prev
Go back to the previous track or video in the mpv media player playlist using natural language commands.
Instructions
Go back to the previous item in the playlist.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:357-361 (registration)Tool registration definition for player_prev in the TOOLS array. No input parameters required.
{ name: "player_prev", description: "Go back to the previous item in the playlist.", inputSchema: { type: "object", properties: {} }, }, - index.js:557-567 (handler)Handler for player_prev: ensures mpv is running, checks if playlist position > 0 (otherwise returns error 'already first song'), sends playlist-prev command with 'weak' flag, ensures playback is not paused, and returns the previous track title.
case "player_prev": { await ensureMpv(); const plPosPrev = await getProperty("playlist-pos").catch(() => 0); if (plPosPrev <= 0) { return fail("已经是第一首,没有上一曲"); } await mpv("playlist-prev", ["weak"]); await setProperty("pause", false); const prevTitle = await getProperty("media-title").catch(() => null); return ok(`Playing previous: ${prevTitle || "unknown"}`); }